diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/builder/association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/association.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index 5fa225f47a..a8559d9d2d 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -54,7 +54,7 @@ module ActiveRecord::Associations::Builder end def build - define_accessors + define_accessors(mixin) configure_dependency if options[:dependent] reflection = ActiveRecord::Reflection.create(macro, name, scope, options, model) Association.extensions.each do |extension| @@ -82,12 +82,12 @@ module ActiveRecord::Associations::Builder # # Post.first.comments and Post.first.comments= methods are defined by this method... - def define_accessors - define_readers - define_writers + def define_accessors(mixin) + define_readers(mixin) + define_writers(mixin) end - def define_readers + def define_readers(mixin) mixin.class_eval <<-CODE, __FILE__, __LINE__ + 1 def #{name}(*args) association(:#{name}).reader(*args) @@ -95,7 +95,7 @@ module ActiveRecord::Associations::Builder CODE end - def define_writers + def define_writers(mixin) mixin.class_eval <<-CODE, __FILE__, __LINE__ + 1 def #{name}=(value) association(:#{name}).writer(value) |