Completed the first join in ActiveRecord