Exception: AssociationScope::PolymorphicAssociationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/association_scope/errors/polymorphic_association_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(association: nil, model: nil) ⇒ PolymorphicAssociationError

Returns a new instance of PolymorphicAssociationError.



8
9
10
11
# File 'lib/association_scope/errors/polymorphic_association_error.rb', line 8

def initialize(association: nil, model: nil)
  @association = association
  @model = model
end

Instance Attribute Details

#associationObject

Returns the value of attribute association.



5
6
7
# File 'lib/association_scope/errors/polymorphic_association_error.rb', line 5

def association
  @association
end

#modelObject

Returns the value of attribute model.



5
6
7
# File 'lib/association_scope/errors/polymorphic_association_error.rb', line 5

def model
  @model
end

Instance Method Details

#messageObject



13
14
15
# File 'lib/association_scope/errors/polymorphic_association_error.rb', line 13

def message
  "Association :#{association} is polymorph in #{model}!"
end