No commit activity in last 3 years
No release in over 3 years
Validate ActiveRecord models based your database schema.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Schema Validations¶ ↑

DRY up your ActiveRecord validations based on schema information.

ActiveRecord::Base.send(:include, SchemaValidations)

Use skip_schema_validations when you need to circumvent validation of specific attributes. This is particularly useful when a field that does not permit nulls will be populated after validation.

class User < ActiveRecord::Base
  skip_schema_validations :crypted_password
end

Much of this code was plagiarized from Simon Harris’ Redhill on Rails work. I simply fixed it up for Rails 2.3.x, added test coverage and removed some of the more problematic validations for uniqueness, precision, scale etc. It’s not quite as comprehensive but it’s a useful foundation to build upon.