dynamo_record 0.0.13 → 0.0.14
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/lib/dynamo_record/document.rb +1 -1
- data/lib/dynamo_record/fields.rb +1 -1
- data/lib/dynamo_record/version.rb +1 -1
- data/spec/dynamo_record/fields_spec.rb +7 -1
- 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: fdc77988251b96b7ff26fe7b64c795030a25535d
|
4
|
+
data.tar.gz: a1d350928ed4043313511a43138fb455202be0ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bc834611cf2826a3adb31404bb0f3acfab75de05a169d4d6ff72974797332f113cdf56019b3ffd6225d262445b0da51ef9de4f2d5f31477c96488fbea26e565
|
7
|
+
data.tar.gz: 74ffa1efc05cdd8268e8b6c1f2004f34e809198cdcb9b80b790956e3ba7a8dc2bc9a72af7e5e905595b89713fdb8b090d822dece8bd73f4f3b8d8a88abd12107
|
@@ -36,7 +36,7 @@ module DynamoRecord
|
|
36
36
|
def load(attrs, ignore_unknown_field=false)
|
37
37
|
attrs.each do |key, value|
|
38
38
|
next if ignore_unknown_field && !respond_to?("#{key}=")
|
39
|
-
send("#{key}=",
|
39
|
+
send("#{key}=", value)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
data/lib/dynamo_record/fields.rb
CHANGED
@@ -45,7 +45,7 @@ RSpec.describe DynamoRecord::Fields do
|
|
45
45
|
expect(person.name).to eq('A person')
|
46
46
|
end
|
47
47
|
|
48
|
-
it 'coearce field to its data type' do
|
48
|
+
it 'coearce field to its data type when intializing' do
|
49
49
|
class Record
|
50
50
|
include DynamoRecord::Document
|
51
51
|
|
@@ -61,6 +61,12 @@ RSpec.describe DynamoRecord::Fields do
|
|
61
61
|
expect(Record.new(boolean_field: 'true').boolean_field).to be_truthy
|
62
62
|
end
|
63
63
|
|
64
|
+
it 'coearce field to its data type when calling writer' do
|
65
|
+
person = Person.new
|
66
|
+
person.created_at = '2015-01-23T04:27:21Z'
|
67
|
+
expect(person.created_at).to eq(DateTime.parse('2015-01-23T04:27:21Z'))
|
68
|
+
end
|
69
|
+
|
64
70
|
describe 'predicate method' do
|
65
71
|
specify { expect(Person.new(activated: false).activated?).to be_falsy }
|
66
72
|
specify { expect(Person.new(activated: true).activated?).to be_truthy }
|