lib/ridgepole/ext/schema_dumper.rb in ridgepole-0.7.4 vs lib/ridgepole/ext/schema_dumper.rb in ridgepole-0.7.5.beta
- old
+ new
@@ -26,16 +26,12 @@
parts = [
"add_foreign_key #{remove_prefix_and_suffix(foreign_key.from_table).inspect}",
remove_prefix_and_suffix(foreign_key.to_table).inspect
]
- if foreign_key.column != @connection.foreign_key_column_for(foreign_key.to_table)
- parts << "column: #{foreign_key.column.inspect}"
- end
+ parts << "column: #{foreign_key.column.inspect}" if foreign_key.column != @connection.foreign_key_column_for(foreign_key.to_table)
- if foreign_key.custom_primary_key?
- parts << "primary_key: #{foreign_key.primary_key.inspect}"
- end
+ parts << "primary_key: #{foreign_key.primary_key.inspect}" if foreign_key.custom_primary_key?
parts << "name: #{foreign_key.name.inspect}"
parts << "on_update: #{foreign_key.on_update.inspect}" if foreign_key.on_update
parts << "on_delete: #{foreign_key.on_delete.inspect}" if foreign_key.on_delete