Merge pull request #667 from ngan/fix-ruby-2.7-deprecations

Fix Ruby 2.7 deprecation warnings
This commit is contained in:
Ernesto Tagwerker 2020-10-09 11:38:57 -04:00 committed by GitHub
commit d4ace20cd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -2,6 +2,7 @@
=== Changes
* Rename `url_whitelist` to `url_allowlist`
* Fixed Ruby 2.7 deprecation warnings
=== Breaking changes
* Failed checks against the allowlist now raise `UrlNotAllowed` rather than `NotWhitelistedUrl`

View File

@ -7,9 +7,9 @@ module DatabaseCleaner
end
# FIXME this method conflates creation with lookup... both a command and a query. yuck.
def [](orm, opts = {})
def [](orm, **opts)
raise ArgumentError if orm.nil?
fetch([orm, opts]) { add_cleaner(orm, opts) }
fetch([orm, opts]) { add_cleaner(orm, **opts) }
end
def strategy=(strategy)
@ -37,8 +37,8 @@ module DatabaseCleaner
private
def add_cleaner(orm, opts = {})
self[[orm, opts]] = Cleaner.new(orm, opts)
def add_cleaner(orm, **opts)
self[[orm, opts]] = Cleaner.new(orm, **opts)
end
def remove_duplicates