Rails 3 generator plugin that generates validator's skeleton files.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
MIT-LICENSE
README
README.md
Rakefile
validator_generator.gemspec

README.md

ValidatorGenerator

Rails3でカスタムvalidatorのスケルトンファイルを生成するプラグイン

Requirements

  • Rails >= 3.0.0

installation

In your Gemfile, add this line

gem 'validator_generator'

Then run bundle

$ bundle

Features

  • generates validator

カスタムvalidatorクラスのスケルトンファイルを作成する

$ rails g validator Email
      create  app/validators/email_validator.rb
      invoke  test_unit
      create    test/unit/email_validator_test.rb

$ cat app/validators/email_validator.rb 
class EmailValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
  end
end

Copyright (c) 2011 Kosuke Matsuda, released under the MIT license