services 4.1.3 → 4.1.4

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
  SHA1:
3
- metadata.gz: fb7f8fa1f247c8cd78f746ed04c37863d306d576
4
- data.tar.gz: 00477c2e76f2d8c08eb1baa32af0ff826ea35d8b
3
+ metadata.gz: 1dc5bf4df6a1672dc93cdc1a8999dd2b60c67491
4
+ data.tar.gz: 72a50ae2edad15f05f509f8272c7a888ccf76d4d
5
5
  SHA512:
6
- metadata.gz: 6ebc5ae0f75cbdc234dd491f0e83a8ca31acf3f3d2db1028c22b2891a5a255c1601c9b2a944dd084927e7ae3a3c2683d68093458023976ca0e6762fe5c7c5c6c
7
- data.tar.gz: dd8d2c6ea38ca439d70246adab1345921086bfc41b1c1f341f75dc09b82fafea53fc9d52329c3f163a42b103353822a3af8ec6ebd43fb2a87beec0562b3e261c
6
+ metadata.gz: 6ae6a705a197f1ced734580b48153444b2f311bfb39c96079ba53afaa7623addadfc246de65853bc0100680c217533da534ebd7bdf0eb597b08f850d78ae6fd0
7
+ data.tar.gz: 306927ee9a380fa98928b085f1f4043da4a841dd526de227c51bf45a51cbf622af120599a7717df8f564478af0ac1ef7855cab0759e1e49131d2701b8568a4f7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 4.1.3
2
+
3
+ * Fix finding the find service class
4
+
1
5
  ## 4.1.2
2
6
 
3
7
  * Make "Services" namespace optional when determining object class
data/lib/services/base.rb CHANGED
@@ -48,8 +48,12 @@ module Services
48
48
 
49
49
  def find_service(klass)
50
50
  find_service_name = "#{klass.to_s.pluralize}::Find"
51
- candidates = [find_service_name, "Services::#{find_service_name}"]
52
- candidates.map(&:safe_constantize).compact.first or raise self.class::Error, "Could not find find service (tried: #{candidates.join(', ')})"
51
+ candidates = ["Services::#{find_service_name}", find_service_name]
52
+ # Use a lazy enumerator here because attempting to
53
+ # constantize the find service without a namespace
54
+ # might raise a circular dependency error if it has
55
+ # a namespace
56
+ candidates.lazy.map(&:safe_constantize).detect(&:itself) or raise self.class::Error, "Could not find find service (tried: #{candidates.join(', ')})"
53
57
  end
54
58
 
55
59
  def find_objects(ids_or_objects, klass = object_class)
@@ -1,3 +1,3 @@
1
1
  module Services
2
- VERSION = '4.1.3'
2
+ VERSION = '4.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: services
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Meurer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake