Enforce Schema Rules plugin

Plugin details

This plugin provides a way to validate your model against databse rules you've already created in your schema, including column lengths for strings, "not null" designations, unique index constraints, and ensuring integer input for integer columns.

Repositoryhttp://enforce-schema-rules.googlecode.com/svn/trunk/enforce_schema_rules/ Author Josh Starcher Tags Schema LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://enforce-schema-rules.googlecode.com/svn/trunk/enforce_schema_rules/

Examples:

  class Person < ActiveRecord::Base
    enforce_schema_rules :except => :dhh
  end

  class Book < ActiveRecord::Base
    enforce_column_limits  :message => "exceeds the %d character limit", :on => :update
    enforce_unique_indexes
    enforce_not_null :exclusion_regexp => /$fk_/
  end

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago