Displaying 2 results from an estimated 2 matches for "scope_messages_to_mailbox".
2006 Jul 24
1
meantime_filter won''t pick up my missing methods
...e({
:find => { :conditions => [ "#{foreign_key} = ?",
params[foreign_key] ]},
:create => { :user_id => params[foreign_key] }
}, &block)
end
end
</pre></code>
Creates methods like ''scope_products_to_user'',
''scope_messages_to_mailbox'', etc.
The problem is meantime_filter isn''t running my method_missing method.
<code><pre>
meantime_filter :scope_products_to_user #=> NameError: undefined method
`scope_products_to_user'' for class `ProductsController''
</pre></code>...
2006 Jul 24
0
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/
--
Posted via http://www.ruby-...