module ActsAsStrippableOn::Core

Public Instance Methods

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