kasket 3.1.4 → 3.1.5

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: f991371eb51fc1fa71c6902a9f7521011eaad4a3
4
- data.tar.gz: 585665215a4aad97c63f41395965e2f53397a18d
3
+ metadata.gz: ce801eb80f7eda453f07735fd934423d4fb925ca
4
+ data.tar.gz: 5815830b14132e65b2f0395dfb5eef1a1fcaa344
5
5
  SHA512:
6
- metadata.gz: 56dd49026d082012079b32fb729e70228081333327026461c8b1a0a2e624ec4cb1cd0d8240800ffbc0f1cf76a8c4870b2d11fc15963afec4fa5d186de6eda8e7
7
- data.tar.gz: 62c542fe0a7c6d867b685c8d46d0b021dfc4ee36bc004d207e735845f9bd15ced98f474d5e1ff99c6082efcabe05b5d1fefc72049f31b291af6549b1e9c3c7e2
6
+ metadata.gz: 89cbd7cb351b9e25af6b5f02afe1715e0c5a56556303161ee00846a1e087822eec8ca591d67a9e63dea6e80bbcae15cec901195567dd1c1cb800fa960a4fb017
7
+ data.tar.gz: 5bf55e25bfbe743cc1dc6a1236cda1afc1cc3df0b34513acbc99d3f15973593fcf11a639e306f02beecfa6add59f665277dd774167293910888d07906a74710c
@@ -22,7 +22,7 @@ module Kasket
22
22
  end
23
23
 
24
24
  query[:key] = klass.kasket_key_for(query[:attributes])
25
- query[:key] << '/first' if query[:limit] == 1 && query[:index] != [:id]
25
+ query[:key] << '/first' if query[:limit] == 1 && !query[:index].include?(:id)
26
26
 
27
27
  query
28
28
  end
@@ -3,7 +3,7 @@ module Kasket
3
3
  class Version
4
4
  MAJOR = 3
5
5
  MINOR = 1
6
- PATCH = 4
6
+ PATCH = 5
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  PROTOCOL = 4
9
9
  end
@@ -48,4 +48,14 @@ class FindOneTest < ActiveSupport::TestCase
48
48
  other_blog.posts.find(post.id)
49
49
  end
50
50
  end
51
+
52
+ should "use same scope when finding on has_many" do
53
+ post = Blog.first.posts.first
54
+ blog = Blog.first
55
+ Rails.cache.clear
56
+
57
+ post = blog.posts.find_by_id(post.id)
58
+ key = post.kasket_key.sub(%r{(/id=#{post.id})}, "/blog_id=#{Blog.first.id}\\1")
59
+ assert(Kasket.cache.read(key))
60
+ end
51
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-28 00:00:00.000000000 Z
12
+ date: 2013-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.0.6
177
+ rubygems_version: 2.0.3
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: A write back caching layer on active record