0.0
No commit activity in last 3 years
No release in over 3 years
Allows the setting of default model values by simply creating a defaults method on a model which returns a hash of values.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

SimpleDefaults¶ ↑

This is a simple way to provide defaults for active record models with minimal setup.

Setup¶ ↑

Once the gem is installed, add a defaults method to your model which returns a hash.

Class Person < ActiveRecord::Base
   def defaults
     { name: 'Jim' }
   end
end

All types of values are accepted as well as procs and lambdas.

Copyright © 2014 Paul Janse van Rensburg. See LICENSE.txt for further details.