module UsefullAttributesExtension

Public Instance Methods

usefull_attribute_names(*black_list) click to toggle source
# File lib/spyro/usefull_attributes.rb, line 9
def usefull_attribute_names *black_list
  black_list = black_list.first if black_list.first.is_a? Array
  (self.attribute_names - ['id', 'created_at', 'updated_at'] - black_list.map(&:to_s)).map(&:to_sym)
end
usefull_attributes(*black_list) click to toggle source
# File lib/spyro/usefull_attributes.rb, line 4
def usefull_attributes *black_list
  black_list = black_list.first if black_list.first.is_a? Array
  self.attributes.except(*['id', 'created_at', 'updated_at'] + black_list.map(&:to_s))
end