MailValidation
A simple validator for email addresses. Internally, the mail gem is utilized to parse the email address.
LoLwut? Why not use a regex?
Rails already depends on the mail gem, so why not utilize that dependency to parse email addresses properly? Framework wise, it makes sense that we would rely on the mail gem for all things email related.
Usage
With ActiveRecord:
class User < ActiveRecord::Base
validates :email, "MailValidation::Email" => true
end
With just ActiveModel:
class User
include ActiveModel::Model
end
Installation
Add this line to your application's Gemfile:
gem 'mail_validation'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mail_validation
Usage
TODO: Write usage instructions here
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request