On 18 July 2014 06:41, Eugene Gilburg <eugene.gilb...@gmail.com> wrote: > ... > BTW you can also simplify this query: > > record = History.where(user_id: current_user, question_id: > play_list[0][0]).first
Or even better record = current_user.histories.where(question_id: play_list[0][0]) But even then I suspect something looks ideal. I feel unconfortable when I see arrays of arrays. I would have expected to see a relationship of some sort between users and play_list and history. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtBZB_Z9mjXo15z70%2BUrE%2BNz4Skyqv4n-t44Gu3DnaNtQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.