distant 0.1.7 → 0.1.8
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/Gemfile.lock +1 -1
- data/distant.gemspec +1 -1
- data/lib/distant/base.rb +1 -1
- data/spec/client/base_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5047b3a44d35e47ccd5aa8430acda91ae52c9c3d
|
4
|
+
data.tar.gz: 7d812f37ef7b05c12cda42cd2653c957de16c207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6598e3a3df31e46d98767f8e0ba51852d3871bb600c5dad0f778c02cc076dc4652ffcb899e1c0378270ba90049ca6606d259cb8407adeb50eb5fa4f40ad8964
|
7
|
+
data.tar.gz: 739cdb1ddb0ffe034466ac0ed2c1cbdb1e02a741a02c1ebf5a5324f7221d13668eb76844defe1834402133f52fabb9fddf3c52eca16b489aa81df20e0137f84d
|
data/Gemfile.lock
CHANGED
data/distant.gemspec
CHANGED
data/lib/distant/base.rb
CHANGED
@@ -85,7 +85,7 @@ module Distant
|
|
85
85
|
foreign_key_value = self.send(foreign_key_attr)
|
86
86
|
path_generator, captures = self.class.path_closure_generator(route)
|
87
87
|
path_args = captures.map{|x| {x.to_sym => send(x)}}.reduce({}, :merge)
|
88
|
-
path = path_generator.call(
|
88
|
+
path = path_generator.call(path_args)
|
89
89
|
headers = Distant.config.default_headers('')
|
90
90
|
.merge(Distant.config.auth_headers(''))
|
91
91
|
class_ref = Kernel.const_get self.class.to_s.deconstantize + '::' + singular.to_s.classify
|
data/spec/client/base_spec.rb
CHANGED
@@ -25,7 +25,7 @@ describe Distant::Base do
|
|
25
25
|
|
26
26
|
class Distant::SubTest < Distant::Base
|
27
27
|
attr_accessor :id, :base_test_id
|
28
|
-
belongs_to :base_test, ''
|
28
|
+
belongs_to :base_test, '/base/tests/:base_test_id'
|
29
29
|
end
|
30
30
|
end
|
31
31
|
describe '.path_closure_generator(route)' do
|
@@ -162,7 +162,7 @@ describe Distant::Base do
|
|
162
162
|
|
163
163
|
describe '.belongs_to(singular, route)' do
|
164
164
|
before do
|
165
|
-
@route = '/base/:
|
165
|
+
@route = '/base/:base_test_id'
|
166
166
|
Distant::SubTest.belongs_to :base_test, @route
|
167
167
|
end
|
168
168
|
it 'creates an instance method named after the plural collection' do
|