joakimk/minimapper

column_names don't inherit correctly

Opened this issue · 1 comments

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.