module JamRuby
  class AutoEmailer

    belongs_to :user, class_name: "JamRuby::User"

    def hourly_job
      AutoEmailer.where('mailed = false').where("email_at < ", Time.now).each do |auto_emailer|
        AutoMailer.public_send(auto_emailer.name.to_sym, auto_emailer)
      end
    end
  end
end