ruby-on-railsruby-on-rails-3devise-confirmable

How to change the confirmable to be optional in devise?


I have devise for authentication and I have confirmable in devise for User model.

How can I do this? Please help!!


Solution

  • I think you can use skip_confirmation! method here. So it will not fire confirmation mail for user and will be confirmed.

    before_save :require_confirmation, :on => :create
    
    def require_confirmation
       self.skip_confirmation! if field == "value_2"
    end