Sha256: 96f35a868847be4a3787f40e7ed42041fc3008c87f7ac01a867d3b4ac25dce00

Contents?: true

Size: 313 Bytes

Versions: 124

Compression:

Stored size: 313 Bytes

Contents

# An ActiveRecord validator for any radio buttons or select fields with true false
#
# validates :has_credits, boolean: true

class BooleanValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    if value.nil?
      record.errors.add(attribute, "can't be blank")
    end
  end
end

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
effective_resources-2.27.2 app/validators/boolean_validator.rb
effective_resources-2.27.1 app/validators/boolean_validator.rb
effective_resources-2.27.0 app/validators/boolean_validator.rb
effective_resources-2.26.5 app/validators/boolean_validator.rb
effective_resources-2.26.4 app/validators/boolean_validator.rb
effective_resources-2.26.3 app/validators/boolean_validator.rb
effective_resources-2.26.2 app/validators/boolean_validator.rb
effective_resources-2.26.1 app/validators/boolean_validator.rb
effective_resources-2.26.0 app/validators/boolean_validator.rb
effective_resources-2.25.16 app/validators/boolean_validator.rb
effective_resources-2.25.15 app/validators/boolean_validator.rb
effective_resources-2.25.14 app/validators/boolean_validator.rb
effective_resources-2.25.13 app/validators/boolean_validator.rb
effective_resources-2.25.12 app/validators/boolean_validator.rb
effective_resources-2.25.11 app/validators/boolean_validator.rb
effective_resources-2.25.10 app/validators/boolean_validator.rb
effective_resources-2.25.9 app/validators/boolean_validator.rb
effective_resources-2.25.8 app/validators/boolean_validator.rb
effective_resources-2.25.7 app/validators/boolean_validator.rb
effective_resources-2.25.6 app/validators/boolean_validator.rb