Quick Scopes plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install git://github.com/internuity/quick_scopes.git
Examples
===============
With a User model having many Posts
# Standard association method to retrieve all posts user.posts # Order the posts user.posts.order('created_at') # Limit the results to a specific number user.posts.limit(5) # Offset the results user.posts.offset(5) # Include other associated models user.posts.with(:comments) user.posts.with(:comments, :author) user.posts.with({:comments => :author}, :author) # Limit your results with conditions user.posts.where(:published => true)
Note
------------
Some of these don’t promote best practices for your code but can be very useful when working with the console.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 8 months ago


