Had to go look this up today as we are using more named_scopes at work now, although couldn't off the top of my head remember how to get a named_scope to take an argument nicely.

Anyway, the solution is...

named_scope :recent, lambda { |*args| {:conditions => ["created_at >= ?", (args.first || 10.minutes.ago)] } }

Hopefully this helps someone out

I currently work at the Forward Internet Group and we are based in Camden Town in London. We are always exploring new technology to try and solve our problems and we are always on the look-out for talented people who want to learn & innovate. If you think you've got what it takes and you're up for the challenge, why not join us?