Sha256: d102a778a8d092733a20bec3465dd691e8a4142d5715434650de1a49bea761d5

Contents?: true

Size: 465 Bytes

Versions: 2

Compression:

Stored size: 465 Bytes

Contents

module Valle
  class Manager

    class << self

      ##
      # Add validators for all columns of a given class
      #
      # @param [ActiveRecord::Base] klass the AR model class
      #
      def add_validators(klass)
        columns = klass.columns
        columns.each do |original_column|
          column = AbstractAdapter::ColumnWrapper.wrap(original_column)
          ValidationSetter.add_validator(column, klass)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
valle-0.1.0 lib/valle/manager.rb
valle-0.0.3 lib/valle/manager.rb