Module: Tou::Generator
- Defined in:
- lib/tou/generator.rb
Overview
When included into an ActiveRecord, will generate a TOU and prefill it into the “id” attribute if it is blank. Add this module to your records to set their IDs using Tou.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(into) ⇒ Object
6 7 8 9 |
# File 'lib/tou/generator.rb', line 6 def self.included(into) into.before_validation :generate_and_write_touid! super end |