Plugins - Dynamic Scope

StarAdd to favorites

Adds dynamic methods to scope.

Examples

  scope_posts_to_user { yield } #=>
    Post.with_scope({
      :find => { :conditions => [ 'user_id = ?', params[:user_id] ]},
      :create => { :user_id => params[:user_id] }
    }) { yield }

  scope_messages_to_mailbox { yield } #=>
    Message.with_scope({
      :find => { :conditions => [ 'mailbox_id = ?', params[:mailbox_id] ]},
      :create => { :mailbox_id => params[:mailbox_id] }
    }) { yield }

Josh Peek

http://joshpeek.com/svn/plugins/dynamic_scope/

  • Currently 1.7/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?