Exception: Granite::Form::ObjectNotFound

Inherits:
Error
  • Object
show all
Defined in:
lib/granite/form/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(object, association_name, record_id) ⇒ ObjectNotFound

Returns a new instance of ObjectNotFound.



27
28
29
30
31
# File 'lib/granite/form/errors.rb', line 27

def initialize(object, association_name, record_id)
  message = "Couldn't find #{object.class.reflect_on_association(association_name).klass.name}" \
  "with #{object.respond_to?(:_primary_name) ? object._primary_name : 'id'} = #{record_id} for #{object.inspect}"
  super message
end