sessionm-cassandra_object 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6052d6c720f923eec9b114106e5a49d970348bcf
|
4
|
+
data.tar.gz: b3258446a414824776c5e4fd7cc6515448b6220a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a42956c3dcbd6ebf8ea93c6029a4b3dad8e3eebe59287ff0c77b6e06937a0f673b5375eb73c7c42a93bf5205582535c3ff481d1695e0ff403f1924b32106995
|
7
|
+
data.tar.gz: 254dadc67d4d95237075a962cd6037bad649afd0c4541a82d5fb209388ad06d6aac5e2992b69e4857c926f5cf1ebaf4ea819ebc47ce55a298c78f9eabc23915e
|
@@ -14,6 +14,7 @@ module CassandraObject
|
|
14
14
|
included do
|
15
15
|
class_attribute :associations
|
16
16
|
self.associations = {}
|
17
|
+
class_attribute :pluralize_table_names, :instance_writer => false
|
17
18
|
end
|
18
19
|
|
19
20
|
module ClassMethods
|
@@ -29,6 +30,18 @@ module CassandraObject
|
|
29
30
|
super << {:Name=>relationships_column_family, :CompareWith=>"UTF8Type", :CompareSubcolumnsWith=>"TimeUUIDType", :ColumnType=>"Super"}
|
30
31
|
end
|
31
32
|
|
33
|
+
def dangerous_attribute_method?(name)
|
34
|
+
false
|
35
|
+
end
|
36
|
+
|
37
|
+
def generated_association_methods
|
38
|
+
@generated_association_methods ||= begin
|
39
|
+
mod = const_set(:GeneratedAssociationMethods, Module.new)
|
40
|
+
include mod
|
41
|
+
mod
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
32
45
|
def association(association_name, options= {})
|
33
46
|
self.association = self.association.dup
|
34
47
|
if options[:unique]
|
@@ -46,7 +46,7 @@ module CassandraObject
|
|
46
46
|
include Timestamps
|
47
47
|
include NestedAttributes
|
48
48
|
|
49
|
-
attr_accessor :key, :schema_version
|
49
|
+
attr_accessor :key, :schema_version, :association_cache
|
50
50
|
|
51
51
|
include Serialization
|
52
52
|
include Migrations
|
@@ -59,6 +59,7 @@ module CassandraObject
|
|
59
59
|
@readonly = false
|
60
60
|
@attributes = {}.with_indifferent_access
|
61
61
|
self.attributes = attributes
|
62
|
+
@association_cache = {}
|
62
63
|
@schema_version = self.class.current_schema_version
|
63
64
|
end
|
64
65
|
|
@@ -97,6 +97,7 @@ module CassandraObject
|
|
97
97
|
object.instance_variable_set("@key", parse_key(key))
|
98
98
|
object.instance_variable_set("@new_record", false)
|
99
99
|
object.instance_variable_set("@destroyed", false)
|
100
|
+
object.instance_variable_set("@association_cache", {})
|
100
101
|
object.instance_variable_set("@attributes", decode_columns_hash(attributes))
|
101
102
|
end
|
102
103
|
end
|