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
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sqlite_crypto/migration_helpers.rb', line 19 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] ||= IdTypes.string_limit_for(primary_key_type) end super end |