ocean-rails 1.24.2 → 1.25.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4503764ecbaf7727d17852978ec1bd891d1ad78
|
4
|
+
data.tar.gz: f481e468809272a0216791edfa6bacb4e54be380
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e193a45bec1a86983317add48766a50eb6f5d5bdcdbdf419107fcd8132020416cbf7bb7be20f5157a264becc84b4b4dc9175f29a4c0f992924dcd054a4196cb
|
7
|
+
data.tar.gz: 12dd83d6db363cd40df5b6baea61385c669e028e9993682d44d962fdb5700f96bc7a9fcdebf6741f739c7bcc08157130a3f077ec419935ced42286cbc6e325f4
|
data/lib/ocean/api_resource.rb
CHANGED
@@ -47,7 +47,17 @@ module ApiResource
|
|
47
47
|
def collection_internal(conds={}, group, search, page, page_size)
|
48
48
|
if index_only != []
|
49
49
|
new_conds = {}
|
50
|
-
|
50
|
+
ranges = {}
|
51
|
+
index_only.each do |key|
|
52
|
+
val = conds[key]
|
53
|
+
next if val.blank?
|
54
|
+
if ranged_matchers.include?(key) && val.include?(",")
|
55
|
+
from, to = val.split(",")
|
56
|
+
new_conds[key] = DateTime.parse(from)..DateTime.parse(to)
|
57
|
+
else
|
58
|
+
new_conds[key] = val
|
59
|
+
end
|
60
|
+
end
|
51
61
|
conds = new_conds
|
52
62
|
end
|
53
63
|
# Fold in the conditions
|
@@ -35,7 +35,8 @@ module Ocean
|
|
35
35
|
# enumerating the Varnish +BAN+ HTTP request URI suffixes to use to invalidate a
|
36
36
|
# collection of resources.
|
37
37
|
#
|
38
|
-
def ocean_resource_model(index: [:name],
|
38
|
+
def ocean_resource_model(index: [:name],
|
39
|
+
ranged: [],
|
39
40
|
search: :description,
|
40
41
|
page_size: 25,
|
41
42
|
invalidate_member: INVALIDATE_MEMBER_DEFAULT,
|
@@ -43,11 +44,13 @@ module Ocean
|
|
43
44
|
)
|
44
45
|
include ApiResource
|
45
46
|
cattr_accessor :index_only
|
47
|
+
cattr_accessor :ranged_matchers
|
46
48
|
cattr_accessor :index_search_property
|
47
49
|
cattr_accessor :collection_page_size
|
48
50
|
cattr_accessor :varnish_invalidate_member
|
49
51
|
cattr_accessor :varnish_invalidate_collection
|
50
52
|
self.index_only = index
|
53
|
+
self.ranged_matchers = ranged
|
51
54
|
self.index_search_property = search
|
52
55
|
self.collection_page_size = page_size
|
53
56
|
self.varnish_invalidate_member = invalidate_member
|
data/lib/ocean/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocean-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.25.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Bengtson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|