I think I will want to use combine a model level finder with a lambda.
named_scope :recent_snaps, lambda {|since_when| {:conditions=>{:created_at >= since_when}}}
but I am not sure and also if I have the syntax correct, espcially for the parameter piece and can’t run the app right now to check at console.
I do not want to use a find_by_sql or a controller find, I want my finder at the model level for rspec testing.
If you’re on Rails 3 (as you presumably are, given the question’s tags) you should be using
scoperather thannamed_scopeandwhererather thanconditions. Additionally, you can’t use>=in a hash.Your finished scope should look something like this: