module Devise::Models::Confirmable

def unless_confirmed

if it's already confirmed, otherwise adds an error to email.
Checks whether the record is confirmed or not, yielding to the block
def unless_confirmed
  unless confirmed?
    yield
  else
    self.class.add_error_on(self, :email, :already_confirmed)
    false
  end
end