module ActsAsDowncasableOn::Core

Public Instance Methods

acts_as_downcasable_on(*attributes) click to toggle source
# File lib/acts_as_downcasable_on/core.rb, line 5
def acts_as_downcasable_on(*attributes)
  before_validation do
    attributes.each do |attribute|
      next if send(attribute).blank? || !send(attribute).respond_to?(:downcase)
      assign_attributes(attribute => send(attribute).downcase)
    end
  end
end