I have a status report a user can send by email and I want to update a column :sent_mail to true, after the deliver action is completed.
def send_status
date = Date.today
reports = current_user.reports.for_date(date)
ReportMailer.status_email(current_user, reports, date).deliver
reports.update_all(sent_mail: true)
end
and the table class
AddSentMailToReports < ActiveRecord::Migration
def change
add_column :reports, :sent_mail, :boolean, default: false
end
end
However, in console, sent_mail is still set to false.Any ideas why this doesn't work? Thanks!