Module: AR::UUID::TableDefinition
- Defined in:
- lib/ar/uuid/table_definition.rb
Instance Method Summary collapse
- #primary_key(name, type = :primary_key, **options) ⇒ Object
- #references(*args) ⇒ Object (also: #belongs_to)
Instance Method Details
#primary_key(name, type = :primary_key, **options) ⇒ Object
19 20 21 22 |
# File 'lib/ar/uuid/table_definition.rb', line 19 def primary_key(name, type = :primary_key, **) [:default] = ::AR::UUID::Utils.uuid_default_function super(name, type, **) end |
#references(*args) ⇒ Object Also known as: belongs_to
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ar/uuid/table_definition.rb', line 6 def references(*args) = args. [:type] = :uuid unless .include?(:type) unless .include?(:null) [:null] = !::AR::UUID::Utils.belongs_to_required_by_default end super(*args, **) end |