Skip to content
This repository was archived by the owner on Sep 16, 2020. It is now read-only.
This repository was archived by the owner on Sep 16, 2020. It is now read-only.

column_names don't inherit correctly #7

@henrik

Description

@henrik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions