aduki 0.2.0 → 0.2.1

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: b7074743cb0761525eaa92e7b9c6e3c942b2b27d
4
- data.tar.gz: 757b6d2914b0d256e9b2404f959f85a0bd42662d
3
+ metadata.gz: 8040242d5e9e51d7233a9b242be7fa4b36dae799
4
+ data.tar.gz: f0b11e535855d72505939e1a838eba627eef6789
5
5
  SHA512:
6
- metadata.gz: 23d19d50ef586a3dd4a2c29061a2fe8fca8837d235182a97bd9f0dedd1274019761e7b93ca14ef6d9aff0b504fcba8a49d1c6bfa17bb9eadb864b2d209df783a
7
- data.tar.gz: 32443cdd6d8b1ef2008e1f33b4658f6097d6c17e7c2053937fb6bb47368a5fe4f518809b19913da6e266584750e4270ce47848bb34a3b4469aebdfafb8ca3a86
6
+ metadata.gz: 03106a7359d34c1bcc584e626ad33b258cd9f348b57ed3b37d499cccb6d956b99878df9f15a0eb965f75483be692be8104552f3333faf813568fd04ff5a6aee5
7
+ data.tar.gz: 6c7c6c2301e8ee49599093b31fbb32161478a13eb8a7417218ff91831d50b2bc4687a136fc03aef70e94a56c9fa99c272006dd1e42cb9d56531fca77f80d1600
@@ -50,6 +50,7 @@ end
50
50
 
51
51
  def #{name}
52
52
  @#{name} ||= #{klass}.#{finder}(@#{id_method}) unless @#{id_method}.nil? || @#{id_method} == ''
53
+ @#{name}
53
54
  end
54
55
 
55
56
  def #{name}= x
@@ -78,6 +79,7 @@ end
78
79
 
79
80
  def #{name}
80
81
  @#{name} ||= #{klass}.#{finder} @#{id_method} unless @#{id_method}.nil?
82
+ @#{name}
81
83
  end
82
84
 
83
85
  def #{name}= x
@@ -1,3 +1,3 @@
1
1
  module Aduki
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -2,7 +2,7 @@ require "aduki"
2
2
  require "spec_helper"
3
3
 
4
4
  describe Aduki::AttrFinder do
5
- it "should assign a value using attr_finder" do
5
+ it "assigns a value using attr_finder" do
6
6
  props = {
7
7
  "name" => "Eamonn de Valera",
8
8
  "city_name" => "dublin",
@@ -18,4 +18,11 @@ describe Aduki::AttrFinder do
18
18
  expect(politician.city.name).to eq "dublin"
19
19
  expect(politician.gifts).to eq [Gift.lookup("dinner"), Gift.lookup("whiskey"), Gift.lookup("cigars")]
20
20
  end
21
+
22
+ it "does not override a value with unknown identifier" do
23
+ politician = Politician.new city: City.new(""), gifts: [Gift.new(name: "")]
24
+
25
+ expect(politician.city.name).to eq ""
26
+ expect(politician.gifts.map(&:name)).to eq [""]
27
+ end
21
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aduki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conan Dalton