euston-projections 1.0.4-java → 1.0.6-java
Sign up to get free protection for your applications and to get access to all the features.
data/euston-projections.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'euston-projections'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.6'
|
4
4
|
s.platform = RUBY_PLATFORM.to_s == 'java' ? 'java' : Gem::Platform::RUBY
|
5
5
|
s.authors = ['Lee Henson', 'Guy Boertje']
|
6
6
|
s.email = ['lee.m.henson@gmail.com', 'guyboertje@gmail.com']
|
@@ -17,7 +17,15 @@ module Euston
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def if_unhandled_or_new document_type, id, headers
|
20
|
-
|
20
|
+
if id.respond_to? :call
|
21
|
+
query = id
|
22
|
+
attributes = {}
|
23
|
+
else
|
24
|
+
query = ->() { document_type.find(id) }
|
25
|
+
attributes = { _id: id }
|
26
|
+
end
|
27
|
+
|
28
|
+
document = query.call || document_type.new(attributes)
|
21
29
|
|
22
30
|
if_unhandled document, headers do
|
23
31
|
yield document
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: euston-projections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.6
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- Lee Henson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-12-
|
13
|
+
date: 2011-12-08 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|