aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb8
-rw-r--r--activemodel/test/cases/attribute_methods_test.rb2
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index e4caf551ad..af08e67d94 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -326,11 +326,11 @@ module ActiveModel
attribute_method_matchers_cache.clear
end
- def generated_attribute_methods #:nodoc:
- @generated_attribute_methods ||= Module.new.tap { |mod| include mod }
- end
-
private
+ def generated_attribute_methods
+ @generated_attribute_methods ||= Module.new.tap { |mod| include mod }
+ end
+
def instance_method_already_implemented?(method_name)
generated_attribute_methods.method_defined?(method_name)
end
diff --git a/activemodel/test/cases/attribute_methods_test.rb b/activemodel/test/cases/attribute_methods_test.rb
index 4767accb7c..ab46bdf489 100644
--- a/activemodel/test/cases/attribute_methods_test.rb
+++ b/activemodel/test/cases/attribute_methods_test.rb
@@ -116,7 +116,7 @@ class AttributeMethodsTest < ActiveModel::TestCase
test "#define_attribute_method does not generate attribute method if already defined in attribute module" do
klass = Class.new(ModelWithAttributes)
- klass.generated_attribute_methods.module_eval do
+ klass.send(:generated_attribute_methods).module_eval do
def foo
"<3"
end
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index 4d24a980dc..366577761c 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -1005,7 +1005,7 @@ class AttributeMethodsTest < ActiveRecord::TestCase
class_eval(&block)
end
- assert_empty klass.generated_attribute_methods.instance_methods(false)
+ assert_empty klass.send(:generated_attribute_methods).instance_methods(false)
klass
end