Where to find documentation for the finder methods for DataMapper objects?

Skip to first unread message

Dan Tenenbaum

Apr 18, 2014, 5:09:00 PM4/18/14
to datam...@googlegroups.com

The page at 


"The finder methods for DataMapper objects are defined in DataMapper::Repository. They include #get, #all, #first, #last"

with a link to 

However, on that page, there is no documentation for anything with the specified names.

And using the search box to search for methods called 'find' returns no exact matches.

Where's the documentation I'm looking for?


Antonio Antillon

Apr 18, 2014, 11:05:33 PM4/18/14
to datam...@googlegroups.com

Most of the documentation is in the same page you mention. Although it explains in detail all options you can use when calling: Model.all

Model.get(id) will get you a single record from the database
Model.first will get you the first record from the database... or depending if there's a default scope defined, the first record this scope returns
Model.last will get you the last record from the database... or depending if there's a default scope defined, the last record this scope returns

Both :first and :last can be used with a scope defined in your model to retrieve either the first or last record from that specific collection.

You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+...@googlegroups.com.
To post to this group, send email to datam...@googlegroups.com.
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
0 new messages