Module: SimpleFactory::ActiveRecord::TimeMachine
- Defined in:
- lib/simple_factory/active_record/time_machine.rb
Class Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/simple_factory/active_record/time_machine.rb', line 4 def self.included(klass) klass.class_eval do after_create do |model, params| model.created_at = params[:created_at] if params.key?(:created_at) model.updated_at = params[:updated_at] if params.key?(:updated_at) model.save end end end |