rice_cooker 0.1.6 → 0.1.7
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/README.md +8 -0
- data/lib/rice_cooker/class_methods.rb +7 -0
- data/lib/rice_cooker/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: b2552edc5a29457e713b7b2fa3c505a5a306f402
|
|
4
|
+
data.tar.gz: 2c5b2b4dabb9a65006042602f29be764bacd3e79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc79b23fd67e5c673c052dd0a0a67f33cf11b64c0eac4baca51a349be02a05068c28f1e357e54a31897082fa1f47f777f29e22ce0004a2b73d3c9dd0e547b433
|
|
7
|
+
data.tar.gz: 422b1198716ab050ffe818b4b72e1b2c25f52dd180284115fffdc8e4b14aad3bd2970c2cd104f50045b406e9a1842c6b43ea77a5602a96dbe969839ac858fdc9
|
data/README.md
CHANGED
|
@@ -57,7 +57,15 @@ The `range` parameter is a hash allowing filtering for a field, as a key, on two
|
|
|
57
57
|
|
|
58
58
|
For example, the `api.example.org/unicorns?range[age]=21,42` url will return all the unicorns which are between **21** and **42** years old.
|
|
59
59
|
|
|
60
|
+
### Searching
|
|
61
|
+
|
|
62
|
+
The `search` parameter is a hash allowing searching for a field, as a key, on one or several, comma-separated, values. Only the fields containing the given search(es) will be returned (internally, safely executes a `WHERE field LIKE '%SEARCH%'` query).
|
|
63
|
+
|
|
64
|
+
For example, the `api.example.org/unicorns?search[color]=e` url will return all the unicorns with a color containing the letter '**e**'.
|
|
65
|
+
|
|
60
66
|
|
|
61
67
|
## Specification
|
|
62
68
|
|
|
63
69
|
The gem try to follow the [RAPIS](https://github.com/lambda2/rapis) api convention.
|
|
70
|
+
|
|
71
|
+
|
|
@@ -6,6 +6,13 @@ module RiceCooker
|
|
|
6
6
|
|
|
7
7
|
def initialize_model_class!
|
|
8
8
|
# First priority is the namespaced model, e.g. User::Group
|
|
9
|
+
|
|
10
|
+
# Handle InhRes computing
|
|
11
|
+
if self.respond_to? :resource_class
|
|
12
|
+
self.resource_model = self.resource_class
|
|
13
|
+
return self.resource_model
|
|
14
|
+
end
|
|
15
|
+
|
|
9
16
|
self.resource_model ||= begin
|
|
10
17
|
namespaced_class = name.sub(/Controller$/, '').singularize
|
|
11
18
|
namespaced_class.constantize
|
data/lib/rice_cooker/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rice_cooker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andre Aubin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|