module Devise::Orm::DataMapper::Compatibility

Public Instance Methods

assign_attributes(params, *options) click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 56
def assign_attributes(params, *options)
  self.attributes = params
end
changed?() click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 36
def changed?
  dirty?
end
email_changed?() click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 64
def email_changed?
  attribute_dirty?(:email) && self.email.present?
end
email_was() click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 72
def email_was
  original_attributes[:email]
end
encrypted_password_changed?() click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 68
def encrypted_password_changed?
  attribute_dirty?(:email) && self.encrypted_password.present?
end
invalid?() click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 60
def invalid?
  !valid?
end
properties_to_serialize(options=nil) click to toggle source

Redefine #properties_to_serialize in models for more secure defaults. By default, it removes from the serializable model all attributes that are not accessible. You can remove this default by using :force_exclude and passing a new list of attributes you want to exempt. All attributes given to :exclude will simply add names to exempt to Devise internal list.

# File lib/devise/orm/data_mapper/compatibility.rb, line 81
def properties_to_serialize(options=nil)
  options ||= {}
  if options.key?(:force_except) || options.key?(:force_exclude)
    options[:exclude] = options.delete(:force_except) || options.delete(:force_exclude)
    super(options)
  else
    blacklist = Devise::Models::Authenticatable.const_defined?(:BLACKLIST_FOR_SERIALIZATION) ? Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION : []
    except = Array(options[:exclude]) + Array(options[:except]) + blacklist
    super(options.merge(:exclude => except))
  end
end
save(options=nil) click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 40
def save(options=nil)
  if options.is_a?(Hash) && options[:validate] == false
    _persist
  else
    super()
  end
end
update_attribute(name, value) click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 48
def update_attribute(name, value)
  update(name => value)
end
update_attributes(*args) click to toggle source
# File lib/devise/orm/data_mapper/compatibility.rb, line 52
def update_attributes(*args)
  update(*args)
end