gotime-cassandra_object 4.11.1 → 4.11.2
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/gotime-cassandra_object.gemspec +1 -1
- data/lib/cassandra_object/persistence.rb +5 -2
- data/test/unit/persistence_test.rb +5 -2
- 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: 454e795d0c2cd75d06ac16b697b5a5474d39bbfb
|
4
|
+
data.tar.gz: 4cd32e7ebf9b5261e1307652141280dbbfc822f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d2c2577e55d9571bf3015c3df24621143660e820d880921955136e3efa56d2eaac14df25a743b244dc414d02324c820705ffd2ebdf8faea029687c2b4d243f8
|
7
|
+
data.tar.gz: ae2a462f000ac7d8b2110ed355e70322d3148f409bf4a2144e2db27067fa7b872bd337d9d84aae06dac1024abb87ff488e7f8634e1a52aa3bb3311a5da5c7dbb
|
@@ -93,8 +93,11 @@ module CassandraObject
|
|
93
93
|
|
94
94
|
def typecast_persisted_attributes(object, attributes)
|
95
95
|
attributes.each do |key, value|
|
96
|
-
|
97
|
-
|
96
|
+
if definition = attribute_definitions[key]
|
97
|
+
attributes[key] = definition.instantiate(object, value)
|
98
|
+
else
|
99
|
+
attributes.delete(key)
|
100
|
+
end
|
98
101
|
end
|
99
102
|
|
100
103
|
attribute_definitions.each_value do |definition|
|
@@ -4,6 +4,10 @@
|
|
4
4
|
require 'test_helper'
|
5
5
|
|
6
6
|
class CassandraObject::PersistenceTest < CassandraObject::TestCase
|
7
|
+
test 'instantiate removes unknowns' do
|
8
|
+
assert_nil Issue.instantiate('theid', 'z' => 'nooo').attributes['z']
|
9
|
+
end
|
10
|
+
|
7
11
|
test 'encode_attributes' do
|
8
12
|
klass = temp_object do
|
9
13
|
string :description
|
@@ -210,8 +214,7 @@ class CassandraObject::PersistenceTest < CassandraObject::TestCase
|
|
210
214
|
|
211
215
|
ids = []
|
212
216
|
(1..10).each do
|
213
|
-
record = klass.
|
214
|
-
record.save!
|
217
|
+
record = klass.create!(name: 'cool')
|
215
218
|
ids << record.id
|
216
219
|
end
|
217
220
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gotime-cassandra_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.11.
|
4
|
+
version: 4.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Koziarski
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|