Skip to content

Commit d4ace20

Browse files
authored
Merge pull request #667 from ngan/fix-ruby-2.7-deprecations
Fix Ruby 2.7 deprecation warnings
2 parents 303ccad + 0b18230 commit d4ace20

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

History.rdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
=== Changes
44
* Rename `url_whitelist` to `url_allowlist`
5+
* Fixed Ruby 2.7 deprecation warnings
56

67
=== Breaking changes
78
* Failed checks against the allowlist now raise `UrlNotAllowed` rather than `NotWhitelistedUrl`

lib/database_cleaner/cleaners.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def initialize hash={}
77
end
88

99
# FIXME this method conflates creation with lookup... both a command and a query. yuck.
10-
def [](orm, opts = {})
10+
def [](orm, **opts)
1111
raise ArgumentError if orm.nil?
12-
fetch([orm, opts]) { add_cleaner(orm, opts) }
12+
fetch([orm, opts]) { add_cleaner(orm, **opts) }
1313
end
1414

1515
def strategy=(strategy)
@@ -37,8 +37,8 @@ def clean_with(*args)
3737

3838
private
3939

40-
def add_cleaner(orm, opts = {})
41-
self[[orm, opts]] = Cleaner.new(orm, opts)
40+
def add_cleaner(orm, **opts)
41+
self[[orm, opts]] = Cleaner.new(orm, **opts)
4242
end
4343

4444
def remove_duplicates

0 commit comments

Comments
 (0)