0.01
No commit activity in last 3 years
No release in over 3 years
DlValidator is a small gem that performs soft checks against a drivers license number and state. This is used only to flag a drivers license as being invalid, and is not intended to be considered true denial on a drivers license number.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Build Status

DlValidator

DlValidator is a small gem that performs soft checks against a drivers license number and state. This is used only to flag a drivers license as being invalid, and is not intended to be considered true denial on a drivers license number.

The valid method is supported in version >= 0.0.5

Installation

Add this line to your application's Gemfile:

gem 'dl_validator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dl_validator

Usage

With a drivers license number and drivers license state

DlValidator.invalid?('F123456789012', 'FL') => false
DlValidator.invalid?('F7834', 'FL')         => true

DlValidator.valid?('F123456789012', 'FL')   => true
DlValidator.valid?('F7834', 'FL')           => false

Inside your rails model. Dependent on fields :drivers_license_number and :drivers_license_state

class DriversLicense < ActiveRecord::Base
  attr_accessible :drivers_license_number, :drivers_license_state
  validates :drivers_license_number, :drivers_license_state, :drivers_license_invalid => true
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Author

Andrew Medeiros, andrew@amedeiros.com, @_AndrewMedeiros

Contributors

crstamps2

Future

Update active model validation to be more flexible with field names.