I have devise for authentication and I have confirmable
in devise for User
model.
type field
in User
model.value 1
for type then the confirmable should be present.value is 2
then there should not be confirmable and the account should be activated automatically.How can I do this? Please help!!
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