I am trying to get random record with where
. Is it possible to do it in rails? For example, I have this:
Post.where(available: 'true', approved: "true").first
I want to get random record instead of the first one. If it's possible to do it, will it have an effect on the performance?