Dynamic Scope plugin

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 }

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs