Exception: ActiveData::UndefinedPrimaryAttribute
- Inherits:
-
ActiveDataError
- Object
- StandardError
- ActiveDataError
- ActiveData::UndefinedPrimaryAttribute
- Defined in:
- lib/active_data/errors.rb
Instance Method Summary collapse
-
#initialize(klass, association_name) ⇒ UndefinedPrimaryAttribute
constructor
A new instance of UndefinedPrimaryAttribute.
Constructor Details
#initialize(klass, association_name) ⇒ UndefinedPrimaryAttribute
Returns a new instance of UndefinedPrimaryAttribute.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/active_data/errors.rb', line 55 def initialize(klass, association_name) super <<-MESSAGE Undefined primary attribute for `#{association_name}` in #{klass}. It is required for embeds_many nested attributes proper operation. You can define this association as: embeds_many :#{association_name} do primary :attribute_name end MESSAGE end |