Sha256: 7468e888baa8ab80f68f11b778998d350ea673c59e9514afa5b1430cb28f3c1a

Contents?: true

Size: 414 Bytes

Versions: 3

Compression:

Stored size: 414 Bytes

Contents

module BootstrapValidatorRails
  module Validators
    class Presence < Validator
      def generate_data
        data = {}
        return data if unsupported?

        data[:bv_notempty] = 'true'
        data[:bv_notempty_message] = generate_message
        data
      end

      def generate_message
        @record.errors.generate_message(@method, :blank, default: "can't be blank")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bootstrap_validator_rails-0.5.1 lib/bootstrap_validator_rails/validators/presence_validator.rb
bootstrap_validator_rails-0.5.0 lib/bootstrap_validator_rails/validators/presence_validator.rb
bootstrap_validator_rails-0.4.2 lib/bootstrap_validator_rails/validators/presence_validator.rb