- Rails 3 MySQL Concat two fields with comparison
- class << self
- def expired
- where("concat_ws('/', exp_month, exp_year) <= ? OR concat_ws('/', YEAR(expiration_date), MONTH(expiration_date)) <= ?", "#{Date.today.month}/#{Date.today.year}", "#{Date.today.month}/#{Date.today.year}")
- end
- end