Module: Devise::Models::Serializable::ClassMethods

Defined in:
lib/devise/models/serializable.rb

Instance Method Summary collapse

Instance Method Details

#blacklist_keysObject

Returns keys that should be removed when serializing the record.



37
38
39
# File 'lib/devise/models/serializable.rb', line 37

def blacklist_keys
  @blacklist_keys ||= to_adapter.column_names.map(&:to_s) - accessible_attributes.to_a.map(&:to_s)
end

#blacklist_keys?Boolean

Return true if we can retrieve blacklist keys from the record.

Returns:

  • (Boolean)


32
33
34
# File 'lib/devise/models/serializable.rb', line 32

def blacklist_keys?
  @has_except_keys ||= respond_to?(:accessible_attributes) && !accessible_attributes.to_a.empty?
end