Method: DataMapper::Collection#get!
- Defined in:
- lib/dm-core/collection.rb
#get!(*key) ⇒ Resource?
Lookup a Resource in the Collection by key, raising an exception if not found
This looksup a Resource by key, typecasting the key to the proper object if necessary.
189 190 191 |
# File 'lib/dm-core/collection.rb', line 189 def get!(*key) get(*key) || raise(ObjectNotFoundError, "Could not find #{model.name} with key #{key.inspect}") end |