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: c8c030402fac23c1c5582c18fb390760fafad77b
4
- data.tar.gz: 153e5739c2ca48e426e244c9644386729c90d663
3
+ metadata.gz: 6052d6c720f923eec9b114106e5a49d970348bcf
4
+ data.tar.gz: b3258446a414824776c5e4fd7cc6515448b6220a
5
5
  SHA512:
6
- metadata.gz: 34bc064fa9b47e01e82deedd7c76ae77b981671bcb3f7e7cc13046e76d3a0732363851ca82fe77e73c37dcd5c03df20c63397e62f8c55be4338abccf8ec2cb80
7
- data.tar.gz: 05abb454e907e44fa7defc4b98a1077449c5a38d6e032f1b49a141df72431c568af2a0371590fa79ae9b44897ff5911a5716add7442ea8e74fc38a5323dde593
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sessionm-cassandra_object'
5
- s.version = '4.0.0'
5
+ s.version = '4.0.1'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sessionm-cassandra_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski