Exception: Secretary::NoAssociationError

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

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, klass = nil) ⇒ NoAssociationError

Returns a new instance of NoAssociationError.



15
16
17
18
# File 'lib/secretary/errors.rb', line 15

def initialize(name=nil, klass=nil)
  @name   = name
  @klass  = klass
end

Instance Method Details

#messageObject



20
21
22
23
24
# File 'lib/secretary/errors.rb', line 20

def message
  "There is no association named #{@name} for the class #{@klass}. " \
  "Check that you've already declared the association before calling " \
  "'tracks_association', and that you use symbols."
end