dm-redis-adapter 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/README.textile +3 -4
- data/lib/dm_redis.rb +5 -6
- metadata +3 -3
data/MIT-LICENSE
CHANGED
data/README.textile
CHANGED
@@ -12,15 +12,14 @@ h1. Install
|
|
12
12
|
|
13
13
|
Prerequisites:
|
14
14
|
* Redis:
|
15
|
-
** <a href="http://code.google.com/p/redis/">Redis, v1.
|
15
|
+
** <a href="http://code.google.com/p/redis/">Redis, v1.2.1</a>
|
16
16
|
* Gems:
|
17
|
-
** <a href="http://github.com/datamapper/
|
18
|
-
** <a href="http://github.com/datamapper/dm-core/">dm-core</a> v0.10
|
17
|
+
** <a href="http://github.com/datamapper/dm-core/">dm-core</a> v0.10.2
|
19
18
|
|
20
19
|
Install the dm-redis adapter:
|
21
20
|
<pre>
|
22
21
|
<code>
|
23
|
-
>
|
22
|
+
> gem install dm-redis-adapter
|
24
23
|
</code>
|
25
24
|
</pre>
|
26
25
|
|
data/lib/dm_redis.rb
CHANGED
@@ -45,7 +45,6 @@ module DataMapper
|
|
45
45
|
end
|
46
46
|
|
47
47
|
records = query.match_records(records)
|
48
|
-
records = query.limit_records(records)
|
49
48
|
records = query.sort_records(records)
|
50
49
|
records
|
51
50
|
end
|
@@ -141,11 +140,11 @@ module DataMapper
|
|
141
140
|
end
|
142
141
|
end
|
143
142
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
143
|
+
if query.limit
|
144
|
+
@redis.sort("#{query.model.to_s.downcase}:#{redis_key_for(query.model)}:all", :limit => [query.offset, query.limit]).each do |val|
|
145
|
+
keys << {"#{redis_key_for(query.model)}" => val.to_i}
|
146
|
+
end
|
147
|
+
end
|
149
148
|
|
150
149
|
# Keys are empty, fall back and load all the values for this model
|
151
150
|
if keys.empty?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-redis-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Herrera
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-04 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.10.
|
23
|
+
version: 0.10.2
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: redis
|