On Dec 9, 2008, at 9:17 PM, Justin Reagor wrote:

As for scoping contexts, such as AR's named_scopes... does DM have an equal or greater equivalent? It's something I use the most now at my day job, since building advanced queries seems to be easier using them.

From http://datamapper.org/doku.php? id=docs:finders#scopes_and_chaining:

Since DataMapper only executes finders when a kicker method is called, a call to all or first can be chained together to further build a query to the data-store

So by simply defining class methods that return queries, you have the equivalent of named scopes.

Tyler

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to