More comment than answer, but it doesn't fit ...
zed_oxff is on the ball.
To simplify things and keep them DRY, you can consider defining discrete namespaces instead of one large one and linking them together.
For instance:
named_scope :random_order, :order => 'RAND()'
named_scope :limit, :lambda => { |limit| :limit => limit }
named_scope :whatever, ...
So, you will use them as follows:
Person.random_order.limit(3).whatever
source
share