Go back Ruby & Ruby on Rails tricks

Rails Model - alias attribute




class Model < ApplicationRecord
  alias_attribute :send_date, :mail_received_on
end
now you can query  both
Model.where(send_date: 7.days.ago..2.days.ago)
Model.where(mail_received_on: 7.days.ago..2.days.ago)