![](https://secure.gravatar.com/avatar/b28f5874c43177f2a7b3477706d70196.png?default=mp&rating=pg&size=250)
sailaja
Joined
60 Experience
0 Lessons Completed
0 Questions Solved
Activity
I recommend using sort_by instead:
objects.sort_by {|obj| obj.attribute}
Especially if attribute may be calculated.
Posted in Method returns true in a rails app controller, but returns false in resque worker when File.exists?
Try running your worker behind an after_commit callback. It might be because your worker started running even if the data hasn't persisted in your DB yet.