services 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/services/base.rb +2 -2
- data/lib/services/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c148465c5f9136b280c87824fb53878b9e17e05d
|
4
|
+
data.tar.gz: 3fd963a4ec9b77e26a2cd2c0bacfe9e1f7924ecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d963a730efde270e4137e45f08465a127f27a15581a4c8cc26401ae1b0101bc19737097200502b57004b73fc4b4e8fce3a5b4b15e0347d88e1bab339155ee3f0
|
7
|
+
data.tar.gz: 23fc5b5174f0ecf0ec261b35fcb886f67907a506f755fc7fb13c10a93f74aede3eec0005eca608ef0e7fada73342a02ae08f9bc44825aa630d789ee7a90ad0ac
|
data/lib/services/base.rb
CHANGED
@@ -39,7 +39,7 @@ module Services
|
|
39
39
|
raise 'Array can only contain IDs.' if ids_or_objects.any? { |ids_or_object| !ids_or_object.is_a?(Fixnum) }
|
40
40
|
objects = "Services::#{klass.to_s.pluralize}::Find".constantize.call(ids_or_objects)
|
41
41
|
missing_ids = ids_or_objects - objects.pluck(:id)
|
42
|
-
raise self.class::Error, "#{klass.to_s.pluralize(missing_ids)} #{missing_ids.join(', ')} not found." if missing_ids.
|
42
|
+
raise self.class::Error, "#{klass.to_s.pluralize(missing_ids)} #{missing_ids.join(', ')} not found." if missing_ids.size > 0
|
43
43
|
return objects
|
44
44
|
when Fixnum
|
45
45
|
object = "Services::#{klass.to_s.pluralize}::Find".constantize.call(ids_or_objects).first
|
@@ -56,7 +56,7 @@ module Services
|
|
56
56
|
|
57
57
|
def controller
|
58
58
|
@controller ||= begin
|
59
|
-
raise 'Please configure host.'
|
59
|
+
raise 'Please configure host.' if Services.configuration.host.nil?
|
60
60
|
request = ActionDispatch::TestRequest.new
|
61
61
|
request.host = Services.configuration.host
|
62
62
|
ActionController::Base.new.tap do |controller|
|
data/lib/services/version.rb
CHANGED