Change deprecated changed? methods to new in callbacks

This commit is contained in:
Alex Sherman 2020-01-29 15:41:03 +05:00
parent 95ad3086b0
commit 01114386b3
7 changed files with 14 additions and 9 deletions

View file

@ -28,7 +28,7 @@ class Contact < ApplicationRecord
validates :phone, presence: true, e164: true, phone: true
validates :email, format: /@/
validates :email, email_format: { message: :invalid }, if: proc { |c| c.email_changed? }
validates :email, email_format: { message: :invalid }, if: proc { |c| c.will_save_change_to_email? }
validates :code,
uniqueness: { message: :epp_id_taken },