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

18 views
Skip to first unread message

Dan Tenenbaum

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

The page at 


says:

"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?

Thanks,
DAn

Antonio Antillon

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

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
Forward
0 new messages