mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Merge pull request #667 from ngan/fix-ruby-2.7-deprecations
Fix Ruby 2.7 deprecation warnings
This commit is contained in:
commit
d4ace20cd0
2 changed files with 5 additions and 4 deletions
|
@ -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`
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue