minimapper
minimapper copied to clipboard
column_names don't inherit correctly
Failing test includes
class TestAgedUser < TestUser
attributes :age
end
it "inherits attributes" do
TestAgedUser.column_names.should == [ "id", "created_at", "updated_at", "name", "age" ]
end
We can't use a class ivar because they don't inherit. A class @@var is shared between every class in the inheritance chain IIRC.
In Traco, we use ActiveSupport's class_attribute which inherits the way we want.
Maybe http://stackoverflow.com/a/10729812/6962