gotime-cassandra_object 4.6.0 → 4.7.0
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.
data/README.rdoc
CHANGED
@@ -7,7 +7,6 @@ Cassandra Object uses ActiveModel to mimic much of the behavior in ActiveRecord.
|
|
7
7
|
|
8
8
|
Add the following to your Gemfile:
|
9
9
|
|
10
|
-
gem 'cassandra', require: '1.0'
|
11
10
|
gem 'gotime-cassandra_object'
|
12
11
|
|
13
12
|
Change the version of Cassandra accordingly. Recent versions have not been backward compatible.
|
@@ -29,14 +28,14 @@ Change the version of Cassandra accordingly. Recent versions have not been backw
|
|
29
28
|
|
30
29
|
== Connecting to the Server
|
31
30
|
|
32
|
-
CassandraObject::Base.
|
31
|
+
CassandraObject::Base.config = {
|
33
32
|
keyspace: 'my_app_development',
|
34
33
|
servers: '127.0.0.1:9160',
|
35
34
|
thrift: {
|
36
35
|
timeout: 20
|
37
36
|
retries: 2
|
38
37
|
}
|
39
|
-
|
38
|
+
}
|
40
39
|
|
41
40
|
== Creating and updating records
|
42
41
|
|
@@ -26,11 +26,11 @@ module CassandraObject
|
|
26
26
|
def define_attribute_methods
|
27
27
|
return if attribute_methods_generated?
|
28
28
|
super(attribute_definitions.keys)
|
29
|
-
|
29
|
+
@attribute_methods_generated = true
|
30
30
|
end
|
31
31
|
|
32
32
|
def attribute_methods_generated?
|
33
|
-
|
33
|
+
@attribute_methods_generated ||= false
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -98,8 +98,10 @@ module CassandraObject
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def typecast_attributes(object, attributes)
|
101
|
-
attributes = attributes.symbolize_keys
|
102
|
-
Hash[attribute_definitions.map { |k, attribute_definition|
|
101
|
+
#attributes = attributes.symbolize_keys
|
102
|
+
Hash[attribute_definitions.map { |k, attribute_definition|
|
103
|
+
[k.to_s, attribute_definition.instantiate(object, attributes[k.to_sym])]
|
104
|
+
}]
|
103
105
|
end
|
104
106
|
|
105
107
|
def write_option_string(ignore_batching = false)
|
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.
|
4
|
+
version: 4.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-11-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|