bilal
bilal

Reputation: 219

undefined method `confirm!' in devise

I am using devise since for my rails application and been using devise confirmable for users so they have to confirm their email after sign in! I want to remove :confirmable and allow users to sign in without confirm their emails and I removed it and it works but my all rspec fails and it says

undefined method `confirm!' for #<User:0x007fc06db987e8>

There is no method like confirm!. How will I fix it ? (I have no clue) even updated my gem to 3.5.8. I know I can skip the confirmation but i want to remove it! Thanks!

Upvotes: 1

Views: 2596

Answers (2)

everyman
everyman

Reputation: 3407

It's deprecated since 3.4.1 and has been removed recently.

Remove the Devise::Models::Confirmable#confirm! method, use confirm instead.

From: https://github.com/plataformatec/devise/blob/master/CHANGELOG.md#420---2016-07-01

Upvotes: 5

Alexander Shlenchack
Alexander Shlenchack

Reputation: 3869

When you removing :confirmable module the confirm! method also will be removed from user instances. Because confirm! and confirm methods are located in the Devise::Models::Confirmable. In some your specs you use confirmation. Check out your specs.

Upvotes: 2

Related Questions