opi 0.4.3 → 0.4.4

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: 53ac0fb7d35e2dcbdd535f9f4142f0714abf6735
4
- data.tar.gz: 059c4e77a4c7a9b62fd87871081afe080e4d1022
3
+ metadata.gz: 05b7f01c02b84e5a661ba8a40c1df8c1f4ac7761
4
+ data.tar.gz: 06b261defb82e1d4b097c0614b49da332f8dfad1
5
5
  SHA512:
6
- metadata.gz: 309590e6916000a3c7b1c0f2ee287cd3690be801ea3b3d2d497ae1095b1ff0428ace423b9073a83b816a5b7d1e8d4f8085810460444b6d3ebe8f8f696983d3d4
7
- data.tar.gz: d0ab6dc92dd12939fa9975bd8472fe4d75bfbfeeb19b11f7a94c62cfc756009a0e6965e36d3ae9de5bb26b1282ecba03ed411da7ff8ca04e7af530601b564845
6
+ metadata.gz: 2b5f22c221190b7c317b04ce5b8223f6ff31882ad3e6609f162e8f9af2c1f2e2464c0bcc1cfaa4308d6aa3c79833063a84260add2dce940d022e8d05776b7508
7
+ data.tar.gz: 538affbc696026dc7da2879d4ab2fb48c436f3ce9e4663b65431fbecb03ed0cb3685fbca1de79575596fc90e6cc4fabcb3420563bdc4d286dec60460a139c78c
@@ -39,7 +39,13 @@ module Opi
39
39
  def resource(path, options={}, &block)
40
40
  # TODO: clean this up, should be able to determine the child resource path
41
41
  root = "#{self.root}/#{path}"
42
- root = "#{self.root}/:id/#{path}" unless self.root.empty?
42
+ # TODO: should be able to determine parent resource name, need to store name separately
43
+ unless self.root.empty?
44
+ # TODO: need to singularize ...
45
+ parent_resource = self.root.split('/').last.gsub(/s$/, '')
46
+ puts parent_resource
47
+ root = "#{self.root}/:#{parent_resource}_id/#{path}"
48
+ end
43
49
  resources << Resource.new(
44
50
  root,
45
51
  self.options.merge(options),
@@ -1,3 +1,3 @@
1
1
  module Opi
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor