Permalink
Browse files

Ensure attribute methods are included after all the AR stuff

  • Loading branch information...
1 parent 1029c51 commit a1ee3ac654078ef57832b8e9833ac13afcb944fa @jonleighton jonleighton committed Dec 24, 2011
@@ -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
@@ -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
@@ -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

0 comments on commit a1ee3ac

Please sign in to comment.