File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -347,8 +347,8 @@ def hide_default?(col_type, options)
347
347
348
348
# The fk columns might be composite keys, so format them into
349
349
# a string for the annotation
350
- def stringify_fk_columns ( columns )
351
- columns . class == Array ? columns . join ( ", " ) : columns
350
+ def stringify_columns ( columns )
351
+ columns . class == Array ? "[ #{ columns . join ( ", " ) } ]" : columns
352
352
end
353
353
354
354
def get_foreign_key_info ( klass , options = { } )
@@ -372,9 +372,9 @@ def get_foreign_key_info(klass, options = {})
372
372
max_size = foreign_keys . map ( &format_name ) . map ( &:size ) . max + 1
373
373
374
374
foreign_keys . sort_by { |fk |
375
- [ format_name . call ( fk ) , stringify_fk_columns ( fk . column ) ]
375
+ [ format_name . call ( fk ) , stringify_columns ( fk . column ) ]
376
376
} . each do |fk |
377
- ref_info = "#{ stringify_fk_columns ( fk . column ) } => #{ fk . to_table } .#{ fk . primary_key } "
377
+ ref_info = "#{ stringify_columns ( fk . column ) } => #{ fk . to_table } .#{ stringify_columns ( fk . primary_key ) } "
378
378
constraints_info = ''
379
379
constraints_info += "ON DELETE => #{ fk . on_delete } " if fk . on_delete
380
380
constraints_info += "ON UPDATE => #{ fk . on_update } " if fk . on_update
You can’t perform that action at this time.
0 commit comments