ユーザーが電子メールで送信できるステータス レポートがあり、配信アクションが完了した後で、列 :sent_mail を true に更新したいと考えています。
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
そしてテーブルクラス
AddSentMailToReports < ActiveRecord::Migration
def change
add_column :reports, :sent_mail, :boolean, default: false
end
end
ただし、コンソールでは、sent_mail はまだ false に設定されています。これが機能しない理由はありますか? ありがとう!