Module: Saintly::Rails::ClassMethods

Defined in:
lib/saintly.rb

Instance Method Summary collapse

Instance Method Details

#sanctify(*args) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/saintly.rb', line 45

def sanctify(*args)
  options =  args.last.instance_of?(Hash) ? args.pop : {}
  define_attribute_methods
  
  args.each do |col|
    define_method (col.to_s+"_with_saintly").to_sym do
        Saintly.sanitize(read_attribute(col))
    end
    alias_method_chain col, :saintly
  end
end