Changed ActiveRecord query from id to user_id to avoid ambiguous column