Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mpdaugherty/is_a_validator

A small gem that adds an "is_a" validator to Rails.
https://github.com/mpdaugherty/is_a_validator

Last synced: about 1 month ago
JSON representation

A small gem that adds an "is_a" validator to Rails.

Awesome Lists containing this project

README

        

* IsAValidator

Provides an ActiveRecord validator that ensures a polymorphic association

* is an instance of specific class or one of its subclasses or
* implements a specific Concern

** Usage:

#+BEGIN_SRC ruby
belongs_to :account, polymorphic: true
validates :account, is_a: Account
#+END_SRC

* Development & Testing

Ruby version is managed by =rvm= & =.rvmrc=

#+BEGIN_SRC shell
gem install bundler
bundle install
bundle exec appraisal install
bundle exec appraisal rspec
#+END_SRC

** Generating Docs

#+BEGIN_SRC shell
bundle exec rdoc
#+END_SRC

** Tagging & Deploying a new version

#+BEGIN_SRC shell
# Update lib/is_a_validator/version.rb
gem build is_a_validator.gemspec
git tag -a vX.X -m "Releasing vX.X"
git push origin vX.X
#+END_SRC

* License

IsAValidator is released under an MIT-LICENSE. Use it how you see fit.