Exception: ActiveData::ObjectNotFound

Inherits:
ActiveDataError show all
Defined in:
lib/active_data/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(object, association_name, record_id) ⇒ ObjectNotFound

Returns a new instance of ObjectNotFound.



41
42
43
44
45
# File 'lib/active_data/errors.rb', line 41

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