-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Given a model that looks like
class user < ActiveRecord::Base
enum_attr :status %w{suspended pending approved}
enum_attr :role %w{regular moderator admin}
endWhen attempting to run annotate on that model,
Then I get the following error
Unable to annotate user.rb: #<MetaProgramming::AliasMethodChainError: method_missing_without_enumerated_attribute already exists. Circular references not permitted.>
Nothing annotated.
I seem to have narrowed it down to the fact that enum_attr is being used twice in the model. Removing (or commenting out) one or both allows the model to be annotated as expected, even when both enums are defined in the migration. My guess is that method_missing_without_enumerated_attribute is being defined each time enum_attr is used, but I don't know enough about the internals of enumerated_attribute to determine this.
Metadata
Metadata
Assignees
Labels
No labels