Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions