0.0
No commit activity in last 3 years
No release in over 3 years
An utility which provides a class method `strip_fields`. It accepts list of fields and removes leading and trailing whitespaces before validation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5.2
~> 10.1.1
~> 3.0.0.beta2

Runtime

 Project Readme

Stripper::Rails Code Climate Build Status

An utility which provides a class method strip_fields. It accepts list of fields and removes leading and trailing whitespaces before validation.

Installation

Add this line to your application's Gemfile:

gem 'stripper-rails', '~> 0.0.1'

And then execute:

$ bundle

Or install it yourself as:

$ gem install stripper-rails

Usage

For ActiveRecord:

class User < ActiveRecord::Base

  strip_fields :first_name
end

For Mongoid:

class Article
  include Mongoid::Document

  strip_fields :name
end

Testing

$ bundle
$ bundle exec rspec spec

Contributing

1. Fork it ( https://github.com/kuldeepaggarwal/stripper-rails/fork ).
2. Create your feature branch (`git checkout -b my-new-feature`).
3. Add test cases and verify all tests are green.
4. Commit your changes (`git commit -am 'Add some feature'`).
5. Push to the branch (`git push origin my-new-feature`).
6. Create new Pull Request.