has_finder gem
Gem details
Documentation
Install the Gem:
gem install has_finder
You may have somthing that looks like this in your model:
class Post > ActiveRecord::Base def self.active find(:all, :conditions => {:active => true}) end end
HasFinder replaces this with
class Post > ActiveRecord::Base has_finder :active, :conditions => {:active => true} end
so now you can do somthing like
Post.active.find(:all)
Or add some more conditions that will be merged
Post.active.find(:all, :conditions => {...})
Edit Gem | Back in time (2 older versions) | Last edited by: scott, 3 months ago

