dm-redis-adapter 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dm_redis.rb +14 -17
  2. metadata +2 -2
data/lib/dm_redis.rb CHANGED
@@ -92,20 +92,6 @@ module DataMapper
92
92
 
93
93
  private
94
94
 
95
- ##
96
- # Creates a string representation for the keys in a given model
97
- #
98
- # @param [DataMapper::Model] model
99
- # The query used to locate the resources to be deleted.
100
- #
101
- # @return [String]
102
- # A string representation of the string key for this model
103
- #
104
- # @api private
105
- def redis_key_for(model)
106
- model.key.collect {|k| k.name}.join(":")
107
- end
108
-
109
95
  ##
110
96
  # Saves each resource to the redis data store
111
97
  #
@@ -144,19 +130,16 @@ module DataMapper
144
130
  if @redis.set_member?(key_set_for(query.model), o.value)
145
131
  keys << {"#{redis_key_for(query.model)}" => o.value}
146
132
  end
147
- return keys
148
133
  end
149
134
  find_matches(query, o).each do |k|
150
135
  keys << {"#{redis_key_for(query.model)}" => k, "#{o.subject.name}" => o.value}
151
136
  end
152
- return keys
153
137
  end
154
138
 
155
139
  if query.limit
156
140
  @redis.sort(key_set_for(query.model), :limit => [query.offset, query.limit]).each do |val|
157
141
  keys << {"#{redis_key_for(query.model)}" => val.to_i}
158
142
  end
159
- return keys
160
143
  end
161
144
 
162
145
  # Keys are empty, fall back and load all the values for this model
@@ -168,6 +151,20 @@ module DataMapper
168
151
 
169
152
  keys
170
153
  end
154
+
155
+ ##
156
+ # Creates a string representation for the keys in a given model
157
+ #
158
+ # @param [DataMapper::Model] model
159
+ # The query used to locate the resources to be deleted.
160
+ #
161
+ # @return [String]
162
+ # A string representation of the string key for this model
163
+ #
164
+ # @api private
165
+ def redis_key_for(model)
166
+ model.key.collect {|k| k.name}.join(":")
167
+ end
171
168
 
172
169
  ##
173
170
  # Return the key string for the set that contains all keys for a particular resource
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.8
4
+ version: 0.0.9
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-03-01 00:00:00 -08:00
12
+ date: 2010-03-03 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency