Skip to content
Browse files

Merge pull request #12390 from kennyj/rename_to_association_methods

Renamed generated_feature_methods to generated_association_methods.

Conflicts:
	activerecord/lib/active_record/associations/builder/association.rb
	activerecord/lib/active_record/associations/builder/singular_association.rb
	activerecord/test/cases/base_test.rb
  • Loading branch information...
2 parents 679902b + 8e814a0 commit 5a011409a46811a9bd46400cc0147d4a85fa02e9 @rafaelfranca rafaelfranca committed Nov 5, 2013
View
2 activerecord/lib/active_record/associations/builder/association.rb
@@ -88,7 +88,7 @@ def self.define_callbacks(model, reflection)
#
# 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)
View
2 activerecord/lib/active_record/associations/builder/singular_association.rb
@@ -8,7 +8,7 @@ def self.valid_options(options)
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
View
8 activerecord/lib/active_record/core.rb
@@ -91,12 +91,12 @@ module ClassMethods
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
View
2 activerecord/lib/active_record/nested_attributes.rb
@@ -335,7 +335,7 @@ def accepts_nested_attributes_for(*attr_names)
# 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

0 comments on commit 5a01140

Please sign in to comment.
Something went wrong with that request. Please try again.