dynamo_record 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynamo_record/document.rb +7 -1
- data/lib/dynamo_record/fields.rb +1 -1
- data/lib/dynamo_record/version.rb +1 -1
- data/spec/dynamo_record/fields_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 175ef0c5bc93ee3c4931cc3fe09b93fce238fb68
|
4
|
+
data.tar.gz: 14195e2cc9c545cf441c275a037a2cd5b8fd1796
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb015bce411ca4009e53c0f1a107cf8adeb92a385a0c619114f94d29e3be03ae2c5f4ecd797491631bd09bbdb233cb86db754fae31afd0a31911d89f6467904e
|
7
|
+
data.tar.gz: 80a062be38333b404aa6dd62188992d848097292714e6f51c58801e00d58818a1c1a2f3f0e91923807ba100ffe410e78819587041c3e22c62f8caa9465878d07
|
@@ -19,7 +19,7 @@ module DynamoRecord
|
|
19
19
|
|
20
20
|
end
|
21
21
|
|
22
|
-
attr_accessor :new_record
|
22
|
+
attr_accessor :new_record
|
23
23
|
|
24
24
|
def initialize(attrs = {}, ignore_unknown_field = false)
|
25
25
|
@new_record = true
|
@@ -39,5 +39,11 @@ module DynamoRecord
|
|
39
39
|
send("#{key}=", self.class.undump_field(value, self.class.attributes[key.to_sym]))
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
43
|
+
def attributes=(hash)
|
44
|
+
hash.each do |k, v|
|
45
|
+
send("#{k}=", v)
|
46
|
+
end
|
47
|
+
end
|
42
48
|
end
|
43
49
|
end
|
data/lib/dynamo_record/fields.rb
CHANGED
@@ -75,4 +75,13 @@ RSpec.describe DynamoRecord::Fields do
|
|
75
75
|
expect(attrs[:created_at]).to eq(now.iso8601)
|
76
76
|
end
|
77
77
|
end
|
78
|
+
|
79
|
+
describe '#attributes=' do
|
80
|
+
it 'set attributes from hash' do
|
81
|
+
person = Person.new(name: 'A Person', activated: true)
|
82
|
+
person.attributes = {name: 'Updated Person'}
|
83
|
+
expect(person.name).to eq('Updated Person')
|
84
|
+
expect(person.activated).to eq(true)
|
85
|
+
end
|
86
|
+
end
|
78
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamo_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nguyen Vu Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|