From 8e814a0ac0768816974d2bfd68d33d931592751e Mon Sep 17 00:00:00 2001 From: kennyj Date: Sat, 28 Sep 2013 12:23:58 +0900 Subject: Renamed generated_feature_methods to generated_association_methods. --- .../lib/active_record/associations/builder/association.rb | 2 +- .../active_record/associations/builder/singular_association.rb | 2 +- activerecord/lib/active_record/core.rb | 8 ++++---- activerecord/lib/active_record/nested_attributes.rb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index 1059fc032d..17b74b197e 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -83,7 +83,7 @@ module ActiveRecord::Associations::Builder # Post.first.comments and Post.first.comments= methods are defined by this method... def define_accessors(model) - mixin = model.generated_feature_methods + mixin = model.generated_association_methods define_readers(mixin) define_writers(mixin) end diff --git a/activerecord/lib/active_record/associations/builder/singular_association.rb b/activerecord/lib/active_record/associations/builder/singular_association.rb index d97c0e9afd..e81cc99278 100644 --- a/activerecord/lib/active_record/associations/builder/singular_association.rb +++ b/activerecord/lib/active_record/associations/builder/singular_association.rb @@ -12,7 +12,7 @@ module ActiveRecord::Associations::Builder def define_accessors(model) super - define_constructors(model.generated_feature_methods) if constructable? + define_constructors(model.generated_association_methods) if 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 366ebde418..0167ddb5e5 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 -- cgit v1.2.3