This project is archived and is in readonly mode.
named_scope doesn't work when 2 procs expect arguments
-
Frederick Cheung
- Tag changed from activerecord, block, bug, named_scope, proc to activerecord, block, bug, edge, named_scope, proc
Is the problem that sort_by scope you've defined is being (in some cases) shadowed by the built in sort_by method on arrays ? (ie if you change it to order_by then does it work ?)
-
Frederick Cheung
- State changed from new to invalid
A quick experiment reveals that to be the case. Change sort_by to order_by and you're good to go.
-
Nando Vieira
Make sense... I didn't remember the
sort_bymethod. :/