Low commit activity in last 3 years
No release in over a year
Easy way to normalize attributes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

schema-normalize

Basic concept is to apply filtering/normalization methods to attributes. Primary interface is to call normalize on the model. This way you can control when the methods are applied.

class Person < ActiveRecord::Base
  include Schema::Normalize

  normalize :name, :strip, if: :name_changed?
  normalize :value, :round, args: [2], if: :value_changed?

  before_validation :normalize
end