Project

roshi

0.0
Low commit activity in last 3 years
No release in over a year
ActiveModel/ActiveRecord Validation Collection For Mainly Japanese
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.3
>= 0
>= 0
~> 13.0.6

Runtime

 Project Readme

Roshi

Gem Version Build Status

ActiveModel/ActiveRecord Validation Collection For Mainly Japanese

Installation

Add this line to your application's Gemfile:

gem 'roshi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install roshi

Usage

class TestModel
  validates :email, email: true
  validates :zip_code, zip_code: true # zip_code: { hiphenation: true }
  validates :phone_number, phone_number: true # phone_number: { hiphenation: true }
  validates :date, date: true
  validates :hiragana, hiragana: true # hiragana: { allow_space: true }
  validates :katakana, katakana: true # katakana: { allow_space: true }
  validates :version_number, version_number: true
  validates :accept_word, available_word: { accept_words: %w(accept available) }
  validates :reject_word, available_word: { reject_words: %w(reject unavailable) }
  validates :large_value, numerical_comparison: { greater_than: :small_value }
  validates :large_value, numerical_comparison: { greater_than_or_equal_to: :small_value }
  validates :large_value, numerical_comparison: { equal_to: :small_value }
  validates :small_value, numerical_comparison: { less_than_or_equal_to: :large_value }
  validates :small_value, numerical_comparison: { less_than: :large_value }
  validates :middle_value, numerical_comparison: { between: { min: :small_value, max: :large_value } }
end

Contributing

  1. Fork it ( https://github.com/fusic/roshi/fork )
  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 a new Pull Request