Skip to content

midas/dynamic_validations

Repository files navigation

dynamic_validations

github.com/midas/dynamic_validations/tree/master

DESCRIPTION:

Easily make your rails app’s validation configurable by the end user by storing the validation rules in the database.

FEATURES:

  • Generates the necessary validation rule table migration

  • Provides a validation rule ActiveRecord model

  • Overrides validation method for models with has_dynamic_validations macro

PROBLEMS:

REQUIREMENTS:

INSTALL:

sudo gem install midas-dynamic_validations

USAGE:

Add to environment file:

config.gem "midas-dynamic_validations", :version => '00.2'

In an environment initializer:

DYNAMIC_VALIDATIONS_CONFIG = {
  :messages => {
    :presence => "cannot be blank"
  }
}

In an ActiveRecord model:

has_dynamic_valdiations

LICENSE:

(The MIT License)

Copyright © 2009 C. Jason Harrelson (midas)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Easily make your rails app's validation configurable by the end user.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages