Skip to content
/ ratel Public

A bad words validator for Rails applications

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE.txt
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

petlove/ratel

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.

About

A bad words validator for Rails applications

Topics

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE.txt
MIT
MIT-LICENSE

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published