cached_model 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/cached_model.rb +1 -1
- data/test/test_cached_model.rb +9 -0
- metadata +2 -2
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ $VERBOSE = nil
|
|
8
8
|
|
9
9
|
spec = Gem::Specification.new do |s|
|
10
10
|
s.name = 'cached_model'
|
11
|
-
s.version = '1.2.
|
11
|
+
s.version = '1.2.1'
|
12
12
|
s.summary = 'An ActiveRecord::Base model that caches records'
|
13
13
|
s.authors = 'Robert Cottrell, Eric Hodel'
|
14
14
|
s.email = 'bob@robotcoop.com'
|
data/lib/cached_model.rb
CHANGED
data/test/test_cached_model.rb
CHANGED
@@ -55,6 +55,7 @@ class ActiveRecord::Base
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def self.find_by_sql(query)
|
58
|
+
return [] if query =~ /concrete\.id = -1/
|
58
59
|
return [new]
|
59
60
|
end
|
60
61
|
|
@@ -325,6 +326,14 @@ class TestCachedModel < Test::Unit::TestCase
|
|
325
326
|
assert_equal record, Cache.cache[record.cache_key_memcache]
|
326
327
|
end
|
327
328
|
|
329
|
+
def test_class_find_by_sql_no_record
|
330
|
+
q = "SELECT * FROM concrete WHERE (concrete.id = -1) LIMIT 1"
|
331
|
+
|
332
|
+
records = Concrete.find_by_sql q
|
333
|
+
|
334
|
+
assert_equal [], records
|
335
|
+
end
|
336
|
+
|
328
337
|
def test_class_ttl
|
329
338
|
assert_equal 900, CachedModel.ttl
|
330
339
|
CachedModel.ttl = 800
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.99
|
|
3
3
|
specification_version: 1
|
4
4
|
name: cached_model
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.2.
|
7
|
-
date: 2006-08-
|
6
|
+
version: 1.2.1
|
7
|
+
date: 2006-08-18 00:00:00 -07:00
|
8
8
|
summary: An ActiveRecord::Base model that caches records
|
9
9
|
require_paths:
|
10
10
|
- lib
|