sessionm-cassandra_object 4.0.14 → 4.0.15

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: 8d5b8754c020a2164f225fb51980c0ed60355a70
4
- data.tar.gz: 86039a18effac02bf7b388419e162c8dbd20b852
3
+ metadata.gz: 9dcee4e003abd64bad04d78620d2fc05160c8edd
4
+ data.tar.gz: d75cf2ef6ec176801bc10741199ad59071cb7401
5
5
  SHA512:
6
- metadata.gz: b033ec8fb81bb806f0633b97aec8b18066659f41631386d969c086d505db2d93ae4daa9fc51e5ebf44a6ce8dc2bd11901a66b3f4e9ea1e79b2d0c6cdefce5342
7
- data.tar.gz: 74edbed2735249853f0dfed08b287cc95bdc9b8905e376998609cacc584a6c73d285eb469177864249d18328bc14521999939051c72c13f2465863427df18e40
6
+ metadata.gz: a92b846e3fdc6acdab89f5d840fbce593ceb2ec00961a8b817293e66eba2408b217491d1ab61d415d11d1456cd78f8cf289212673d263c488be6f302c56a3b17
7
+ data.tar.gz: b37740caa7397acea99ce7694c6613a0a0b9769f7f581b534c6adf62390724abe628f8264aeea339bcc7ab38e0ceee0f4659573d5d5ee6899b994970974e9ee8
@@ -66,7 +66,12 @@ module CassandraObject
66
66
  end
67
67
 
68
68
  def read_attribute(name)
69
- @attributes[name.to_s]
69
+ name = name.to_s
70
+ if name == 'id'
71
+ id
72
+ else
73
+ @attributes[name]
74
+ end
70
75
  end
71
76
 
72
77
  alias _read_attribute read_attribute
@@ -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.14'
5
+ s.version = '4.0.15'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
@@ -16,5 +16,14 @@ describe CassandraObject::Associations do
16
16
  expect(role.user.id).to eq user.id
17
17
  expect(user.issue.id).to eq issue.id
18
18
  end
19
+
20
+ it "should set the foreign key attribute when assigned through the belongs_to relationship" do
21
+ issue = Issue.create! :description => 'web site not working', :worth => 1.5
22
+ user = User.create! :position => 1, :issue => issue
23
+ expect(user.issue_id).to eq issue.id
24
+
25
+ user.issue = issue
26
+ expect(user.issue_id).to eq issue.id
27
+ end
19
28
  end
20
29
  end
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.14
4
+ version: 4.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-15 00:00:00.000000000 Z
12
+ date: 2016-03-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Cassandra ActiveModel
15
15
  email: doug@sessionm.com