minimapper icon indicating copy to clipboard operation
minimapper copied to clipboard

column_names don't inherit correctly

Open henrik opened this issue 11 years ago • 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.

henrik avatar May 23 '13 09:05 henrik

Maybe http://stackoverflow.com/a/10729812/6962

henrik avatar May 23 '13 09:05 henrik