diff options
4 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index d8d68eb908..37ba1c73b1 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -88,7 +88,7 @@ module ActiveRecord::Associations::Builder # # Post.first.comments and Post.first.comments= methods are defined by this method... def self.define_accessors(model, reflection) - mixin = model.generated_feature_methods + mixin = model.generated_association_methods name = reflection.name define_readers(mixin, name) define_writers(mixin, name) diff --git a/activerecord/lib/active_record/associations/builder/singular_association.rb b/activerecord/lib/active_record/associations/builder/singular_association.rb index 2a4b1c441f..66b03c0301 100644 --- a/activerecord/lib/active_record/associations/builder/singular_association.rb +++ b/activerecord/lib/active_record/associations/builder/singular_association.rb @@ -8,7 +8,7 @@ module ActiveRecord::Associations::Builder def self.define_accessors(model, reflection) super - define_constructors(model.generated_feature_methods, reflection.name) if reflection.constructable? + define_constructors(model.generated_association_methods, reflection.name) if reflection.constructable? end # Defines the (build|create)_association methods for belongs_to or has_one association diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index d9cb14e4c6..d93c26c130 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -91,12 +91,12 @@ module ActiveRecord def initialize_generated_modules super - generated_feature_methods + generated_association_methods end - def generated_feature_methods - @generated_feature_methods ||= begin - mod = const_set(:GeneratedFeatureMethods, Module.new) + def generated_association_methods + @generated_association_methods ||= begin + mod = const_set(:GeneratedAssociationMethods, Module.new) include mod mod end diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index df28451bb7..9d92e747d4 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -335,7 +335,7 @@ module ActiveRecord # the helper methods defined below. Makes it seem like the nested # associations are just regular associations. def generate_association_writer(association_name, type) - generated_feature_methods.module_eval <<-eoruby, __FILE__, __LINE__ + 1 + generated_association_methods.module_eval <<-eoruby, __FILE__, __LINE__ + 1 if method_defined?(:#{association_name}_attributes=) remove_method(:#{association_name}_attributes=) end |