Skip to content

Commit 366cfd3

Browse files
committed
Merge pull request #81 from pelletencate/master
Fix a bug in `dirty_hash_to_rule`
2 parents 1932b3b + 38eacc3 commit 366cfd3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/recurring_select.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ def self.dirty_hash_to_rule(params)
77
if params.is_a? IceCube::Rule
88
params
99
else
10-
if params.is_a?(String)
11-
params = JSON.parse(params)
10+
params = JSON.parse(params, quirks_mode: true) if params.is_a?(String)
11+
if params.nil?
12+
nil
13+
else
14+
params = params.symbolize_keys
15+
rules_hash = filter_params(params)
16+
IceCube::Rule.from_hash(rules_hash)
1217
end
1318

14-
params = params.symbolize_keys
15-
rules_hash = filter_params(params)
16-
17-
IceCube::Rule.from_hash(rules_hash)
1819
end
1920
end
2021

0 commit comments

Comments
 (0)