method

define_accessors

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: SingularAssociation
define_accessors(model, reflection) 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/associations/builder/singular_association.rb, line 11
    def self.define_accessors(model, reflection)
      super
      mixin = model.generated_association_methods
      name = reflection.name

      define_constructors(mixin, name) unless reflection.polymorphic?

      mixin.class_eval         def reload_#{name}          association(:#{name}).force_reload_reader        end        def reset_#{name}          association(:#{name}).reset        end, __FILE__, __LINE__ + 1
    end
Register or log in to add new notes.