redis_object 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/redis_object/base.rb +3 -7
- data/lib/redis_object/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGI0NTJhZWFiNDUyMTQ2NDYzOGJhNmI1ZWE1MjZhOGVkZGVkNjM0NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWQ5NzIzMjEzOTlkN2VlNTE2MDBlZTQzMDE2ZjdiOWJhYjIxMTg4MA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjNlMGJmNDc3NTgxYjlkNDkyYjUwMjQ2NWQ3ZGNhOWJhMDY1MTJmZjA5MzAw
|
10
|
+
YzhlZWZhNWE0MWY4OGZmNjM4ODUzZDE3YTE3NzQ3MDUxMjg4MmQ0NDRmNjg5
|
11
|
+
NGRjYTU2MzI4NmZjMjk2YzNmNDlhYWU0NzRkZWViMmJiZmJhNzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTAwYTc3OTgyZWMwMzY2NDQyNDI3ZWE5YTc5M2U3MWVkYzhlN2NiOTliMTky
|
14
|
+
M2ExOWYyYTZhYmViY2Q1OTI1NmQ5OGRmOWRhMDhkNWFkMWE1ODBhM2M1N2Y0
|
15
|
+
MWU2YTc3ZTQ3MTYzZjFiZGQ1YmM3OTYwM2UyMWU0OWExMDk0ZWI=
|
data/lib/redis_object/base.rb
CHANGED
@@ -394,22 +394,18 @@ module Seabright
|
|
394
394
|
|
395
395
|
def find_by_key(k)
|
396
396
|
if store.exists(k) && (cls = store.hget(k,:class))
|
397
|
-
return deep_const_get(cls.to_sym).new(store.hget(k,id_sym(cls)))
|
397
|
+
return deep_const_get(cls.to_sym,Object).new(store.hget(k,id_sym(cls)))
|
398
398
|
end
|
399
399
|
nil
|
400
400
|
end
|
401
401
|
|
402
|
-
def deep_const_get(const)
|
402
|
+
def deep_const_get(const,base=nil)
|
403
403
|
if Symbol === const
|
404
404
|
const = const.to_s
|
405
405
|
else
|
406
406
|
const = const.to_str.dup
|
407
407
|
end
|
408
|
-
|
409
|
-
base = Object
|
410
|
-
else
|
411
|
-
base = self
|
412
|
-
end
|
408
|
+
base ||= const.sub!(/^::/, '') ? Object : self
|
413
409
|
const.split(/::/).inject(base) { |mod, name| mod.const_get(name) }
|
414
410
|
end
|
415
411
|
|
data/lib/redis_object/version.rb
CHANGED