Exception: AssociationScope::AssociationMissingError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(missing_in: "Model", association: nil) ⇒ AssociationMissingError

Returns a new instance of AssociationMissingError.



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

def initialize(missing_in: "Model", association: nil)
  @missing_in = missing_in
  @association = association
end

Instance Attribute Details

#associationObject

Returns the value of attribute association.



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

def association
  @association
end

#missing_inObject

Returns the value of attribute missing_in.



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

def missing_in
  @missing_in
end

Instance Method Details

#messageObject



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

def message
  "Association :#{association} missing in #{missing_in}!"
end