module Devise::Models
def add_error_on(record, attribute, error, add_default=true)
def add_error_on(record, attribute, error, add_default=true) options = add_default ? { :default => error.to_s.gsub("_", " ") } : {} begin record.errors.add(attribute, error, options) rescue ArgumentError record.errors.add(attribute, error.to_s.gsub("_", " ")) end end