flexirest 1.3.19 → 1.3.20

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: 0982726f28cbf1e5d5c3eb83e3748a5ce6fdf6ef
4
- data.tar.gz: 4944b84e08c350442e8b683c7850e2034dd7a21c
3
+ metadata.gz: a08b537f83b7e91f676166915c6db2858aaf3858
4
+ data.tar.gz: a1962938bb89f82b79640aa29e619ec3ba48d857
5
5
  SHA512:
6
- metadata.gz: 3704be3d5ab6cc0d255670b49bc12392c5d5d157eaa422a367619f7110318b300bf2fc9508e264ef745d6a854920e91869ef00b68db252492b73ac8518cd19ea
7
- data.tar.gz: 45113de45f00c0e0d2f9e51722274379f96e7d09b498d0e1e65e75385b1f1197ae66d21f5af3819698c875173d3ee307bc16460a6f31054ec52da088a706ae5d
6
+ metadata.gz: d1af9fae82540fcff4c45dcedd9c5074743188531b1481a3d02ace07ab1cdcc537d8b505027a818f18dcff3f1a0a90ec7ee57fc1f0d0502d4a52de206dc71ba0
7
+ data.tar.gz: b3eaa600d7ecd24034168a57ec10376ed1b5a4f29570f6762f3ff7eea2ecbf82f48ba036d5a401edd4d986bcda2c6c34e681a4d7bca7fbf25052e438d93bbf25
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.20
4
+
5
+ Bugfix:
6
+
7
+ - Fixed `has_one` association raising an error if there is no associated object (it should just return `nil`) (thanks to Azat Galikhanov for the PR)
8
+
3
9
  ## 1.3.19
4
10
 
5
11
  Feature:
data/doc/FLEXIREST.svg ADDED
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="840px" height="159px" viewBox="0 0 840 159" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 3.7.2 (28276) - http://www.bohemiancoding.com/sketch -->
4
+ <title>FLEXIREST</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <path d="M0.1328125,2 L76.3046875,17 L73.9609375,40.5351562 L29.4296875,33.5351562 L29.4296875,64.7929688 L60.875,64.7929688 L60.875,89.6953125 L29.4296875,89.6953125 L29.4296875,150.828125 L0.1328125,158.171875 L0.1328125,2 Z M121.226562,22 L121.226562,114.5625 L172.007812,110.5625 L167.320312,134 L92.0273438,141 L92.0273438,18.34375 L121.226562,22 Z M186.851562,28 L263.023438,31 L260.679688,54.4375 L216.148438,51.4375 L216.148438,65.1796875 L247.691406,65.1796875 L247.59375,90.375 L216.148438,90.375 L216.148438,108.5625 L264.585938,103.5625 L262.242188,127 L186.851562,132 L186.851562,28 Z M318.492188,96.0273438 L297.300781,126 L269.566406,127 L306.773438,75.828125 L271.03125,32 L306.089844,32 L321.472656,57.9648438 L341.441406,32 L369.371094,32 L335.582031,70.1640625 L374.546875,126 L339.683594,126 L318.492188,96.0273438 Z M387.242188,34.34375 L416.539062,34 L416.539062,125.828125 L387.242188,126.171875 L387.242188,34.34375 Z M444.451493,126.06876 L444.451493,34.7098354 L479.794593,33.9804687 C487.950734,33.9804687 495.394719,32.4768383 502.126772,33.4695922 C508.858825,34.4623462 514.636004,36.0223647 519.458485,38.1496946 C524.280965,40.2770245 528.002957,42.9817319 530.624574,46.2638981 C533.246191,49.5460642 534.556979,53.4562405 534.556979,57.9945442 C534.556979,61.033587 534.039137,63.7686844 533.003436,66.1999185 C531.967736,68.6311527 530.511304,70.7989706 528.634097,72.7034374 C526.75689,74.6079042 524.507512,76.2894826 521.885895,77.7482231 C519.264279,79.2069636 516.367597,80.5036023 513.195765,81.6381783 C513.195765,81.6786989 513.584147,82.2864983 514.360922,83.4615948 C515.137697,84.6366913 516.1572,86.1764498 517.41946,88.0809166 C518.681719,89.9853834 520.105786,92.1532013 521.691702,94.5844355 C523.277619,97.0156696 524.912059,99.4873873 526.595072,101.999663 C530.54368,107.915666 535.169711,120.113718 540.218751,127.610023 L511.448029,126.980469 L484.843608,84.4340836 L473.483325,84.4340836 L473.483325,124.610027 L444.451493,126.06876 Z M473.375,64.5976562 L483.335938,64.5976562 C486.26564,64.5976562 489.065091,64.487167 491.734375,64.2661851 C494.403659,64.0452033 496.763662,63.6032462 498.814453,62.9403006 C500.865245,62.277355 502.492833,61.3418792 503.697266,60.1338451 C504.901699,58.9258109 505.503906,57.3200335 505.503906,55.3164647 C505.503906,53.7253953 505.031906,52.3921581 504.087891,51.3167131 C503.143875,50.2412681 501.841805,49.3720858 500.181641,48.7091402 C498.521476,48.0461947 496.568371,47.5747738 494.322266,47.2948634 C492.076161,47.0149531 489.651055,46.875 487.046875,46.875 L473.375,46.875 L473.375,64.5976562 Z M557.066406,32 L633.238281,29 L630.894531,53.4375 L586.363281,55.4375 L586.363281,68.1796875 L617.90625,68.1796875 L617.808594,93.375 L586.363281,93.375 L586.363281,104.5625 L634.800781,107.5625 L632.457031,131 L557.066406,128 L557.066406,32 Z M706.308437,53.123125 C705.475933,51.3656162 704.701254,49.7006329 703.984375,48.128125 C703.267496,46.5556171 702.435005,45.168131 701.486875,43.965625 C700.538745,42.763119 699.394069,41.8150035 698.052812,41.12125 C696.711556,40.4274965 695.000323,40.080625 692.919062,40.080625 C691.300304,40.080625 689.878131,40.381247 688.6525,40.9825 C687.426869,41.583753 686.420941,42.3931199 685.634687,43.410625 C684.848434,44.4281301 684.258752,45.6074933 683.865625,46.94875 C683.472498,48.2900067 683.275937,49.7006176 683.275937,51.180625 C683.275937,52.383131 683.460936,53.5162447 683.830938,54.58 C684.200939,55.6437553 684.698122,56.6149956 685.3225,57.49375 C685.946878,58.3725044 686.652184,59.1703089 687.438437,59.8871875 C688.224691,60.6040661 689.010934,61.1937477 689.797187,61.65625 L707.002187,71.715625 C711.072208,74.0281366 714.402175,76.4562373 716.992188,79 C719.5822,81.5437627 721.605618,84.0643625 723.0625,86.561875 C724.519382,89.0593875 725.52531,91.4759258 726.080312,93.8115625 C726.635315,96.1471992 726.959062,98.2631155 727.051562,100.159375 C727.051562,105.293151 726.184384,109.975916 724.45,114.207812 C722.715616,118.439709 720.322203,122.058735 717.269687,125.065 C714.217172,128.071265 710.621271,130.395304 706.481875,132.037188 C702.342479,133.679071 697.867837,134.5 693.057812,134.5 C688.61779,134.5 684.547831,133.829382 680.847812,132.488125 C677.147794,131.146868 673.852514,129.285324 670.961875,126.903437 C668.071236,124.521551 665.573761,121.700329 663.469375,118.439688 C661.364989,115.179046 659.665319,111.652519 658.370312,107.86 L675.991562,99.604375 C677.009068,101.269383 678.119056,103.107802 679.321562,105.119687 C680.524069,107.131573 681.865305,109.004679 683.345312,110.739062 C684.82532,112.473446 686.513428,113.918744 688.409687,115.075 C690.305947,116.231256 692.5028,116.809375 695.000312,116.809375 C696.249069,116.809375 697.439994,116.520315 698.573125,115.942187 C699.706256,115.36406 700.700621,114.577817 701.55625,113.583438 C702.411879,112.589058 703.105622,111.455944 703.6375,110.184062 C704.169378,108.912181 704.435313,107.582507 704.435313,106.195 C704.435313,103.373736 703.753132,100.899386 702.38875,98.771875 C701.024368,96.6443644 699.347822,94.9331315 697.359062,93.638125 L678.697187,82.6075 C676.107175,81.1274926 673.736886,79.4393845 671.58625,77.543125 C669.435614,75.6468655 667.562508,73.5540739 665.966875,71.2646875 C664.371242,68.9753011 663.134067,66.5125132 662.255312,63.87625 C661.376558,61.2399868 660.937187,58.418765 660.937187,55.4125 C660.937187,50.6949764 661.781242,46.382207 663.469375,42.4740625 C665.157508,38.565918 667.469985,35.2012641 670.406875,32.38 C673.343765,29.5587359 676.835605,27.3734452 680.8825,25.8240625 C684.929395,24.2746798 689.311539,23.5 694.029063,23.5 C701.244099,23.5 707.418412,25.3384191 712.552187,29.0153125 C717.685963,32.6922059 721.478425,38.0687146 723.929688,45.145 L706.308437,53.123125 Z M748.960938,41.4375 L751.304688,18 L839.195312,0 L836.851562,25.4375 L808.824219,31.4375 L808.824219,152.828125 L779.527344,148.171875 L779.527344,36.4375 L748.960938,41.4375 Z" id="FLEXIREST" fill="#232669"></path>
9
+ </g>
10
+ </svg>
Binary file
Binary file
@@ -39,6 +39,8 @@ module Flexirest
39
39
  @_associations ||= {}
40
40
  @_associations[key] = klass
41
41
  define_method(key) do
42
+ return nil if _attributes[key].nil?
43
+
42
44
  if _attributes[key].is_a?(klass)
43
45
  return _attributes[key]
44
46
  end
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.3.19"
2
+ VERSION = "1.3.20"
3
3
  end
@@ -77,6 +77,11 @@ end
77
77
  describe "Has One Associations" do
78
78
  let(:subject) {AssociationExampleBase.new}
79
79
 
80
+ it "should return nil if it's nil" do
81
+ subject.child = nil
82
+ expect(subject.child).to be_nil
83
+ end
84
+
80
85
  it "should return a list of the association class" do
81
86
  subject.child = {test: "foo"}
82
87
  expect(subject.child).to be_an(AssociationExampleOther)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexirest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.19
4
+ version: 1.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-15 00:00:00.000000000 Z
11
+ date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -225,8 +225,11 @@ files:
225
225
  - README.md
226
226
  - Rakefile
227
227
  - Ruby-on-Rails-Integration.md
228
+ - doc/FLEXIREST.svg
229
+ - doc/FLEXIREST@2x.png
228
230
  - doc/Flexirest Internals.graffle
229
231
  - doc/Flexirest Internals.png
232
+ - doc/Flexirest Logo.sketch
230
233
  - flexirest.gemspec
231
234
  - lib/flexirest.rb
232
235
  - lib/flexirest/associations.rb