Module: SqliteCrypto::MigrationHelpers::References
- Defined in:
- lib/sqlite_crypto/migration_helpers.rb
Instance Method Summary collapse
- #references(*args, **options) ⇒ Object (also: #belongs_to)
Instance Method Details
#references(*args, **options) ⇒ Object Also known as: belongs_to
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sqlite_crypto/migration_helpers.rb', line 18 def references(*args, **) ref_name = args.first ref_table = .delete(:to_table) || ref_name.to_s.pluralize if (primary_key_type = detect_primary_key_type(ref_table)) [:type] ||= :string [:limit] ||= (primary_key_type == :uuid) ? 36 : 26 end super end |