method

deprecated_property_setter

Importance_0
v3.2.1 - Show latest stable - 0 notes - Class: ClassMethods
deprecated_property_setter(property, value, block) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/model_schema.rb, line 337
      def deprecated_property_setter(property, value, block)
        if block
          ActiveSupport::Deprecation.warn(
            "Calling set_#{property} is deprecated. If you need to lazily evaluate "              "the #{property}, define your own `self.#{property}` class method. You can use `super` "              "to get the default #{property} where you would have called `original_#{property}`."
          )

          define_attr_method property, value, false, &block
        else
          ActiveSupport::Deprecation.warn(
            "Calling set_#{property} is deprecated. Please use `self.#{property} = 'the_name'` instead."
          )

          define_attr_method property, value, false
        end
      end
Register or log in to add new notes.