Exception: ActiveModel::Serializer::IncludeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_model/serializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#associationObject (readonly)

Returns the value of attribute association.



47
48
49
# File 'lib/active_model/serializer.rb', line 47

def association
  @association
end

#sourceObject (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_sObject



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