This project is archived and is in readonly mode.
Bind Lambdas in :conditions
-
Alex MacCaw
At the moment you can do:
named_scope :last_week, lambda { ({:conditions => ['assignments.created_at > ?', 7.days.ago.to_s(:db)]}) }
I agree, the normal find should have the same functionality
+1
-
Yaroslav Markin
I am SO +1 on this. As Alex mentioned, named_scope already has this.
Probably it will be possible to merge this stuff on the way to 3.0
-
Neeraj
+1
-
Pratik
- State changed from new to incomplete
- Tag set to activerecord, patch, verified
- Assigned user set to Pratik
Can you please add a test case which will fail for non-lambda version. I tried changing test included in the patch to use "with_scope(:find => {:conditions => ['companies.id = ?', @@count = @@count + 1]})" and the tests passed.
Thanks.
