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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28f6eb35f0ed682487b4386e1f95b2367c9956c3
4
- data.tar.gz: 222daaed9d2614c6cfeec30275d5327e0c57c844
3
+ metadata.gz: 5047b3a44d35e47ccd5aa8430acda91ae52c9c3d
4
+ data.tar.gz: 7d812f37ef7b05c12cda42cd2653c957de16c207
5
5
  SHA512:
6
- metadata.gz: 518d5f087ee08af705f7ba9cdb0bd54dc3b482eb3e51614fa4902b069a9257190bb87a6c5219d1319c7bb51a997fa4a38dd389a37bff6aa7ca95e9c2455e34a8
7
- data.tar.gz: 2be94392e8ab8d23acb09a578156af76d18cc034806cb83047a1638be0cc6f51f7af9435d098da94db35290821b361c4d99c5947a6602b51fdd306ccb7cf52e7
6
+ metadata.gz: c6598e3a3df31e46d98767f8e0ba51852d3871bb600c5dad0f778c02cc076dc4652ffcb899e1c0378270ba90049ca6606d259cb8407adeb50eb5fa4f40ad8964
7
+ data.tar.gz: 739cdb1ddb0ffe034466ac0ed2c1cbdb1e02a741a02c1ebf5a5324f7221d13668eb76844defe1834402133f52fabb9fddf3c52eca16b489aa81df20e0137f84d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- distant (0.1.7)
4
+ distant (0.1.8)
5
5
  activesupport
6
6
  httparty
7
7
 
data/distant.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'distant'
3
- spec.version = '0.1.7'
3
+ spec.version = '0.1.8'
4
4
  spec.authors = ['John Drago']
5
5
  spec.email = 'jdrago.999@gmail.com'
6
6
  spec.homepage = 'https://github.com/distant/distant'
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(id: foreign_key_value)
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
@@ -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/:id'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Drago