Sha256: 71f7f272ae4995b62a6970fe36dde8d8bd4578821e596334038d284207a2b529

Contents?: true

Size: 354 Bytes

Versions: 24

Compression:

Stored size: 354 Bytes

Contents

# frozen_string_literal: true

module Maglev
  class PresenceValidator < ActiveModel::Validations::PresenceValidator
    def validate_each(record, attribute, value)
      value = 'false' if value == false # trick the validator
      super
    end

    private

    def clean_item_errors(item)
      item.errors.full_messages.join(', ')
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
maglevcms-1.7.3 app/validators/maglev/presence_validator.rb
maglevcms-1.7.2 app/validators/maglev/presence_validator.rb
maglevcms-1.7.1 app/validators/maglev/presence_validator.rb
maglevcms-1.7.0 app/validators/maglev/presence_validator.rb
maglevcms-1.6.1 app/validators/maglev/presence_validator.rb
maglevcms-1.6.0 app/validators/maglev/presence_validator.rb
maglevcms-1.5.1 app/validators/maglev/presence_validator.rb
maglevcms-1.4.0 app/validators/maglev/presence_validator.rb
maglevcms-1.3.0 app/validators/maglev/presence_validator.rb
maglevcms-1.2.2 app/validators/maglev/presence_validator.rb
maglevcms-1.2.1 app/validators/maglev/presence_validator.rb
maglevcms-1.2.0 app/validators/maglev/presence_validator.rb
maglevcms-1.1.7 app/validators/maglev/presence_validator.rb
maglevcms-1.1.6 app/validators/maglev/presence_validator.rb
maglevcms-1.1.5 app/validators/maglev/presence_validator.rb
maglevcms-1.1.4 app/validators/maglev/presence_validator.rb
maglevcms-1.1.3 app/validators/maglev/presence_validator.rb
maglevcms-1.1.2 app/validators/maglev/presence_validator.rb
maglevcms-1.1.1 app/validators/maglev/presence_validator.rb
maglevcms-1.1.0 app/validators/maglev/presence_validator.rb