ActiveRecord left join issue fixed