module Devise::Models::Serializable

This module redefines #properties_to_serialize in models for more secure defaults. By default, it removes from the serializable model all attributes whose writer or reader is not public. You can remove this default by using :force_except 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.

Public Instance Methods

properties_to_serialize(options=nil) click to toggle source
# File lib/devise/orm/data_mapper/serializable.rb, line 12
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
    except = Array(options[:exclude]) + Array(options[:except])
    super(options.merge(:exclude => except + self.class.blacklist_keys))
  end
end
to_xml(*args) click to toggle source

Get back to DataMapper’s #to_xml.

# File lib/devise/orm/data_mapper/serializable.rb, line 24
def to_xml(*args)
  super
end