redistry 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -7,6 +7,10 @@ Add `redistry` to your `Gemfile`
7
7
 
8
8
  gem "redistry"
9
9
 
10
+ You can also use your own redis client connection rather than the default `Redis.new` (in an initializer, for example)
11
+
12
+ Redistry.client = Redis.new(:host => 'my-redis-host', :port => 6379)
13
+
10
14
 
11
15
  #### Using has_list
12
16
 
@@ -6,7 +6,9 @@ module Redistry
6
6
  end
7
7
 
8
8
  def deserialize(klass, *objs)
9
- klass.find(objs.flatten)
9
+ ids = objs.flatten
10
+ ar_objects = klass.find(objs.flatten).inject({}) { |h,o| h[o.id.to_s] = o; h }
11
+ ids.map { |i| ar_objects[i.to_s] }
10
12
  end
11
13
  end
12
14
  end
@@ -1,5 +1,5 @@
1
1
  module Redistry
2
2
 
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
 
5
5
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brian Smith
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-07-26 00:00:00 -07:00
17
+ date: 2011-07-29 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency