/ratel

A bad words validator for Rails applications

Primary LanguageRubyMIT LicenseMIT

Build Status Maintainability Test Coverage

A bad words validator for Rails applications

Installation

Add this line to your application's Gemfile:

gem 'ratel', github: 'petlove/ratel'

Using

You can use this gem in two ways:

  1. Using in active models validates
class Person
  include ActiveModel::Validations

  attr_accessor :name

  validates :name, valid_text: true

  #...
end
  1. Using the validator
Ratel::Validator.valid?('linqueta')

Error output

Will be raised this error when the value was invalid:

Person.new('cachorrao').validate!
# => ActiveModel::ValidationError: Validation failed: Name deve ser um valor válido

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

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Rails::Healthcheck project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.