ActsAsDowncasableOn
Easy way to define AR attributes that should be stored in lowercase
Installation
Add this line to your application's Gemfile:
gem 'acts_as_downcasable_on'
And then execute:
$ bundle
Or install it yourself as:
$ gem install acts_as_downcasable_on
Usage
Setup
class User < ActiveRecord::Base
acts_as_downcasable_on :email, :login
end
Attributes email
and login
will be forced to lowercase before model validation.
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