services 7.2.0 → 7.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7aedebb8369e465e6bc0dbde201a6f2e353ef4fb50b9c7e1568914a6aa5c6bdd
4
- data.tar.gz: b9fcc3a9b6a1d38de2257bdab6145c68db707e0665d5538430e3db2ac46bef2e
3
+ metadata.gz: 27e5b3e8dcab03964af30636e451cef509b9155fa721e1323dafdf0ece173364
4
+ data.tar.gz: 76ad367be766868a392826d2b8600fbe96a97da1a42f4cda2f0a75ef64440f6a
5
5
  SHA512:
6
- metadata.gz: '08637ac5fe53454bd404fd069f00179a010cfb0f32295948b403796b7d24ec106b9485a732f2c37d05e9983bc8188ae5e76152c871c77a9fa1f6008ae3e4dfbb'
7
- data.tar.gz: f494e1694f08b16debb2d21d6d82a2473b46822e5ca433d64e5c74b28d85b074937bd94b440c277593253bd5e67b2c1a2b2aaf0058d1155b92ba7880dbf4e772
6
+ metadata.gz: 2302bdb005ff03507cb952a2feb4b9e7171f3e9823d151aacdc39528005c768780d10ad4e35d4fb283ca56d6666b8862ec08df0838a6b39db7a3beda64829a83
7
+ data.tar.gz: 6d55fd8fc4e2e1780343ff14ee56cd9ef89052620e187952a563a5aed0a3b82bad7871b170023d2c9f4cfb4929ea6df776e8e9dc2906fc5b1667d1c512b8ca11
@@ -18,8 +18,8 @@ module Services
18
18
  @redis ||= self.configuration.redis || (defined?(Redis.current) && Redis.current) or fail RedisNotFound, 'Redis not configured.'
19
19
  end
20
20
 
21
- def self.allow_class_method_in_queries(klass, method)
22
- (configuration.allowed_class_methods_in_queries[klass.to_s] ||= Set.new) << method.to_sym
21
+ def self.allow_class_method_in_queries(klass, method, arity = nil)
22
+ (configuration.allowed_class_methods_in_queries[klass.to_s] ||= {})[method.to_sym] = arity
23
23
  end
24
24
  end
25
25
 
@@ -71,8 +71,10 @@ module Services
71
71
  end
72
72
 
73
73
  conditions.each do |k, v|
74
- if (Services.configuration.allowed_class_methods_in_queries[object_class.to_s] || []).include?(k)
75
- case object_class.method(k).arity
74
+ allowed_class_methods = Services.configuration.allowed_class_methods_in_queries[object_class.to_s]
75
+ if allowed_class_methods&.key?(k)
76
+ arity = allowed_class_methods[k] || object_class.method(k).arity
77
+ case arity
76
78
  when 0
77
79
  unless v == true
78
80
  raise ArgumentError, "Method #{k} of class #{self} takes no arguments, so `true` must be passed as the value for this param, not #{v} (#{v.class})."
@@ -1,3 +1,3 @@
1
1
  module Services
2
- VERSION = '7.2.0'.freeze
2
+ VERSION = '7.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: services
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.0
4
+ version: 7.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Meurer