cache-object 0.0.2 → 0.0.3

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: b00384e28562fe8f44389c201a32090c1a8e1a11
4
- data.tar.gz: 8f92dbcb480d43eaf062356bd31477d38f43c481
3
+ metadata.gz: 1353358a8c97cf8dae4728bb24db9b369507b7ce
4
+ data.tar.gz: 990bdcf05d78a4108349e951968f2000d036237c
5
5
  SHA512:
6
- metadata.gz: 0f8b87b32430f50a8095aadf5aaf56e51a9a05461d9e84de9fc67d186866ad94e821cf35853b23994f804cbd074eaeafe57e7095ff5d55e52c5e267072568d5a
7
- data.tar.gz: e3acc42a006c8c8ac416b1474b98857ddf50d5ac3151d00297a36ccf9daf997aabf62b8b4c06112f984d9b88f1fdfe2b622679c9a53e03fa036c6792e31def93
6
+ metadata.gz: 990c15962eb6c8584c1be9472e568de3907c55cfe62f378312b4aba26b3558aaa04abfcc3b4ad7a263c18466974389772478849324ad42307b986935d974f9a2
7
+ data.tar.gz: 4f987b2214a753daab449ff3572eaee7f61942ceeced694f7c7142d09c4cf868937c78ef3b055bd3c36ab5c990b251348dff26a1f905d0b8434e4005894724d7
@@ -18,7 +18,7 @@ module Cache
18
18
  end
19
19
 
20
20
  def canonical_cache_key
21
- KeyGenerator.key_for_object(instance.class.name, instance.id)
21
+ KeyGenerator.key_for_object(instance.class.name, instance.send(instance.class.primary_key))
22
22
  end
23
23
  end
24
24
  end
@@ -1,5 +1,5 @@
1
1
  module Cache
2
2
  module Object
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -4,7 +4,7 @@ RSpec.describe Cache::Object::InstanceDecorator do
4
4
  let(:decorator) { Cache::Object::InstanceDecorator.new(instance, mappings) }
5
5
 
6
6
  describe '#keys' do
7
- let(:instance) { double(id: 1, user_id: 11, sex: 'male', class: double(name: 'User')) }
7
+ let(:instance) { double(id: 1, user_id: 11, sex: 'male', class: double(name: 'User', primary_key: :id)) }
8
8
  let(:mappings) { [[:user_id] , [:user_id, :sex]] }
9
9
 
10
10
  it 'includes the keys based on the mappings' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache-object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Camuto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-23 00:00:00.000000000 Z
11
+ date: 2014-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -179,4 +179,3 @@ test_files:
179
179
  - spec/features/cache_object_spec.rb
180
180
  - spec/spec_helper.rb
181
181
  - spec/support/models.rb
182
- has_rdoc: