encodable_validator

Build Status Dependency Status

A string validator for ActiveModel to verify it can be converted to the specified encodings.

Install

In your Gemfile:

gem 'encodable_validator', :git => "git://github.com/eji/encodable_validator.git"

Usage

In your model:

validates :name, :encodable => {:encodings => [Encoding::EUC_JP, Encoding::ISO_2022_JP]}

or

validates_encodable_of :name, :encodings => [Encoding::EUC_JP, Encoding::ISO_2022_JP]

Version

see VERSION (using semver.org (… possible))

Contributing to encodable_validator

Copyright © 2013 Koji Ejiri. See LICENSE.txt for further details.