Module: RedmineRemotes::Sanitizer::ClassMethods

Defined in:
lib/redmine_remotes/sanitizer.rb

Instance Method Summary collapse

Instance Method Details

#downcase_column(column) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/redmine_remotes/sanitizer.rb', line 22

def downcase_column(column)
  sanitize_method = "#{column}_sanitize"
  define_singleton_method sanitize_method do |column_value|
    ::RedmineRemotes::Sanitizer.downcase_sanitize(column_value)
  end
  define_method "#{column}=" do |column_value|
    self[column] = self.class.send(sanitize_method, column_value)
  end
end

#downcase_columns(*columns) ⇒ Object



18
19
20
# File 'lib/redmine_remotes/sanitizer.rb', line 18

def downcase_columns(*columns)
  columns.each { |column| downcase_column(column) }
end