module Autostrip::Extension

Public Instance Methods

attributes_for_autostrip(attrs) click to toggle source
# File lib/autostrip/extension.rb, line 10
def attributes_for_autostrip(attrs)
  attrs.each_with_object([]) do |attr, memo|
    case attr
      when Regexp
        self.class.columns_hash.values.each { |col| memo << col.name if col.name =~ attr }
      else
        memo << attr
    end
  end
end