Skip to content

Including a module after a call to attributes doesn't work #3

@louismrose

Description

@louismrose

As described in the example "should work when include is last" of specialisation_spec.rb, including a module after calling attributes results in unexpected behaviour:

module Author
    extend Attributable
    attributes articles: []
end

class Columnist
  extend Attributable
  attributes :column
  include Author
end

Columnist.new(articles: [:teen_advice])
# => KeyError: Unknown attributes: articles

When the include occurs before the call to attributes, the error disappears.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions