class Bill
def self.with_company(bill_month)
joins(sanitize_sql_array(['right outer join companies on companies.id = bills.company_id and bills.bill_month = ?', bill_month])).select('bills.*, companies.id as company_id').includes(:user)
end
end
Last active
August 3, 2019 04:43
-
-
Save ryuta-ito/380a502db43cf1c1a2113f6f4ed8108c to your computer and use it in GitHub Desktop.