devise: NoMethodError: undefined method `will_save_change_to_email?'
undefined method `will_save_change_to_email?’ for #User:0x007fc2aea22a88
Devise 4.2.1 from master branch Mongo 2.4.1 Ruby 2.4.1-p111 Rails 5.1.0
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 15 (4 by maintainers)
Commits related to this issue
- Remove deprecation on _changed? methods — committed to heartcombo/devise by rafaelfranca 7 years ago
Ok from master
Problem happens with Rails 5.1 in https://github.com/plataformatec/devise/blob/master/lib/devise/models/validatable.rb.
if Devise.activerecord51?validates_uniqueness_of :email, allow_blank: true, if: :will_save_change_to_email?validates_format_of :email, with: email_regexp, allow_blank: true, if: :will_save_change_to_email?elsevalidates_uniqueness_of :email, allow_blank: true, if: :email_changed?validates_format_of :email, with: email_regexp, allow_blank: true, if: :email_changed?endSame error occurred.
Devise 4.3.0 Mongoid 6.1.1 Ruby 2.4.1-p111 Rails 5.1.1
Does anyone know about this solution?