Exception: ActiveModel::Serializer::IncludeError
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveModel::Serializer::IncludeError
- Defined in:
- lib/active_model/serializer.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
readonly
Returns the value of attribute association.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source, association) ⇒ IncludeError
constructor
A new instance of IncludeError.
- #to_s ⇒ Object
Constructor Details
#initialize(source, association) ⇒ IncludeError
Returns a new instance of IncludeError.
49 50 51 |
# File 'lib/active_model/serializer.rb', line 49 def initialize(source, association) @source, @association = source, association end |
Instance Attribute Details
#association ⇒ Object (readonly)
Returns the value of attribute association.
47 48 49 |
# File 'lib/active_model/serializer.rb', line 47 def association @association end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
47 48 49 |
# File 'lib/active_model/serializer.rb', line 47 def source @source end |
Instance Method Details
#to_s ⇒ Object
53 54 55 |
# File 'lib/active_model/serializer.rb', line 53 def to_s "Cannot serialize #{association} when #{source} does not have a root!" end |