apill 2.3.3 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apill/mixins/queryable.rb +17 -7
- data/lib/apill/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5498c8281d815067fb85ece899fdf7e2e4ccc3f
|
4
|
+
data.tar.gz: 78fd720e12713bbcc9f91046bebd97864ba9e003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81dae0913ba160e54c76c42606e2b21101d29efe23bd05b00df0a635a25a38a1653d7cd167c3e96a53c7fa170595e1f0aef47ea09b01134c95361b0cf8529fad
|
7
|
+
data.tar.gz: 840617d643e3b4a2a3030dd26765237896e394c4cf41a31ee368fb21ce372337cb56d0ae07163f9eb92dab940e3cd743a3c88fc006fdc436ad22167a38c0ddb5
|
@@ -40,16 +40,26 @@ module Queryable
|
|
40
40
|
|
41
41
|
def filtered_resource
|
42
42
|
@filtered_resource ||= begin
|
43
|
-
resource
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
resource = if defined? super
|
44
|
+
super
|
45
|
+
else
|
46
|
+
send(queryed_model_name)
|
47
|
+
end
|
48
|
+
resource_class = if resource.respond_to? :klass
|
49
|
+
resource.klass
|
50
|
+
else
|
51
|
+
resource
|
52
|
+
end
|
48
53
|
|
49
54
|
sanitized_query_params.reduce(resource) do |query_resource, query_param|
|
50
|
-
key, value
|
55
|
+
key, value = query_param
|
56
|
+
query_method_name = query_method_name_for(key, resource_class).to_sym
|
51
57
|
|
52
|
-
|
58
|
+
if resource_class.method(query_method_name).arity == 0
|
59
|
+
query_resource.public_send(query_method_name)
|
60
|
+
else
|
61
|
+
query_resource.public_send(query_method_name, value)
|
62
|
+
end
|
53
63
|
end
|
54
64
|
end
|
55
65
|
end
|
data/lib/apill/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jfelchner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: human_error
|