Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mpdaugherty/is_a_validator
- Owner: mpdaugherty
- License: mit
- Created: 2015-05-19T01:02:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T21:24:35.000Z (over 3 years ago)
- Last Synced: 2024-10-14T00:07:49.524Z (3 months ago)
- Language: Ruby
- Size: 365 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
- License: MIT-LICENSE
- Security: SECURITY.md
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.