Module: AutoUUID::InstanceMethods
- Defined in:
- lib/auto_uuid.rb
Instance Method Summary collapse
Instance Method Details
#before_create ⇒ Object
10 11 12 13 |
# File 'lib/auto_uuid.rb', line 10 def before_create super setup_uuid if (self.respond_to?("uuid=") && self.uuid.nil?) end |
#setup_uuid ⇒ Object
15 16 17 |
# File 'lib/auto_uuid.rb', line 15 def setup_uuid self.uuid = ::UUID.generate end |