sailaja

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Sorting an array of objects in Ruby by object attribute?

I recommend using sort_by instead:

objects.sort_by {|obj| obj.attribute}

Especially if attribute may be calculated.

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.