Skip to content

Commit

Permalink
Fix ruby2_keyword warning (#75)
Browse files Browse the repository at this point in the history
* Revert "Revert "Remove ruby2_keywords flag warning (#70)" (#74)"

This reverts commit 79c17b4.

Co-authored-by: Sunny Ripert <[email protected]>

* Fix syntax when using older ruby version

Co-authored-by: Sunny Ripert <[email protected]>
  • Loading branch information
Thomas Hareau and sunny authored Mar 10, 2022
1 parent 4a863d3 commit 62160a5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/safe-pg-migrations/plugins/legacy_active_record_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

module SafePgMigrations
module LegacyActiveRecordSupport
ruby2_keywords def validate_foreign_key(from_table, to_table = nil, **options)
return super(from_table, to_table || options) unless satisfied? '>=6.0.0'
ruby2_keywords def validate_foreign_key(*args)
return super(*args) if satisfied? '>=6.0.0'

super(from_table, to_table, **options)
from_table, to_table, options = args
super(from_table, to_table || options)
end

ruby2_keywords def foreign_key_exists?(from_table, to_table = nil, **options)
return super(from_table, to_table || options) unless satisfied? '>=6.0.0'
ruby2_keywords def foreign_key_exists?(*args)
return super(*args) if satisfied? '>=6.0.0'

super(from_table, to_table, **options)
from_table, to_table, options = args
super(from_table, to_table || options)
end

protected
Expand Down

0 comments on commit 62160a5

Please sign in to comment.