Module: ActiveRecordUUID::TableDefinition

Defined in:
lib/activerecord_uuid/active_record_extension.rb

Instance Method Summary collapse

Instance Method Details

#uuid(name, options = {}) ⇒ Object



20
21
22
23
# File 'lib/activerecord_uuid/active_record_extension.rb', line 20

def uuid(name, options={})
  @columns.delete @columns_hash.delete('id') if options[:primary_key]
  column(name, :string, limit: 36, null: options[:null] || !options[:primary_key], primary: options[:primary_key])
end