Module: Devise::Models::Serializable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise/orm/data_mapper/serializable.rb
Overview
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.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #properties_to_serialize(options = nil) ⇒ Object
-
#to_xml(*args) ⇒ Object
Get back to DataMapper’s #to_xml.
Instance Method Details
#properties_to_serialize(options = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/devise/orm/data_mapper/serializable.rb', line 12 def properties_to_serialize(=nil) ||= {} if .key?(:force_except) || .key?(:force_exclude) [:exclude] = .delete(:force_except) || .delete(:force_exclude) super() else except = Array([:exclude]) + Array([:except]) super(.merge(:exclude => except + self.class.blacklist_keys)) end end |
#to_xml(*args) ⇒ Object
Get back to DataMapper’s #to_xml.
24 25 26 |
# File 'lib/devise/orm/data_mapper/serializable.rb', line 24 def to_xml(*args) super end |