rice_cooker 0.1.6 → 0.1.7

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: 38aca7c65d34c4bd7e05c32ea0d9622891da212a
4
- data.tar.gz: 1a3c2e7e99a5c771cc40a572455c3c42ec0286f9
3
+ metadata.gz: b2552edc5a29457e713b7b2fa3c505a5a306f402
4
+ data.tar.gz: 2c5b2b4dabb9a65006042602f29be764bacd3e79
5
5
  SHA512:
6
- metadata.gz: 7d3eea6c092876f93a52479dd4eddda5bc6cc11b3b810e32dc46fa3e7cd10bcfa6930b2cef6c3f02eec7659bb147b866dd7b9c38938ef3836a2128f240d0c4d3
7
- data.tar.gz: 7aceacae87cb9e124c6c1d96dc51a24705e874fb097de576776a9affab9308896af0a63d0929c4cbd9d507dcef58c416871eafd3c4e5afb2bcddc51e9c6ac969
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
@@ -1,3 +1,3 @@
1
1
  module RiceCooker
2
- VERSION = '0.1.6'.freeze
2
+ VERSION = '0.1.7'.freeze
3
3
  end
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.6
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-08-02 00:00:00.000000000 Z
11
+ date: 2016-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails