lib/locomotive/mounter/models/base.rb
# Take a list of field names and return a hash with
# their values only if they are not nil.
#
# @param [ Array ] fields List of field names (string)
#
# @return [ Hash ] A hash with symbolize keys
#
Take a list of field names and return a hash with
their values only if they are not nil.
Take a list of field names and return a hash with their values only if they are not nil .
def filter_attributes(fields)
          self.attributes.clone.delete_if do |k, v|
            !fields.include?(k.to_s) || (!v.is_a?(FalseClass) && v.blank?)
          end.deep_symbolize_keys
        end
def filter_attributes ( fields ) self . attributes . clone . delete_if do | k , v | ! fields . include? ( k . to_s ) || ( ! v . is_a? ( FalseClass ) && v . blank? ) end . deep_symbolize_keys end
Take a list of field names and return a hash with
their values only if they are not nil.
Take a list of field names and return a hash with their values only if they are not nil .
A hash with symbolize keys
A hash with symbolize keys
 Hash 
fields
<not_specific>
<not_specific>
fields List of field names (string)
fields List of field names ( string )