Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure attribute methods are included after all the AR stuff

  • Loading branch information...
commit a1ee3ac654078ef57832b8e9833ac13afcb944fa 1 parent 1029c51
Jon Leighton jonleighton authored
2  activerecord/lib/active_record/attribute_methods.rb
View
@@ -52,7 +52,7 @@ def generated_external_attribute_methods
end
def undefine_attribute_methods
- super
+ super if attribute_methods_generated?
@attribute_methods_generated = false
end
2  activerecord/lib/active_record/core.rb
View
@@ -67,7 +67,7 @@ module Core
# The connection handler
class_attribute :connection_handler, :instance_writer => false
- initialize_generated_modules
+ initialize_generated_modules unless self == Base
end
module ClassMethods
1  activerecord/test/cases/base_test.rb
View
@@ -76,6 +76,7 @@ def test_generated_methods_modules
assert(modules.index(Computer.generated_attribute_methods) > modules.index(Computer.generated_feature_methods),
"generated_attribute_methods must be higher in inheritance hierarchy than generated_feature_methods")
assert_not_equal Computer.generated_feature_methods, Post.generated_feature_methods
+ assert(modules.index(Computer.generated_attribute_methods) < modules.index(ActiveRecord::Base.ancestors[1]))
end
def test_column_names_are_escaped
Please sign in to comment.
Something went wrong with that request. Please try again.