Module: Authorize::Redis::ModelReference
- Included in:
- Graph::Edge
- Defined in:
- lib/authorize/redis/model_reference.rb
Overview
Support foreign keys that reference Redis::Base-like models.
Class Method Summary collapse
-
.load_reference(key, klass) ⇒ Object
Load the model whose key is held in the given string key.
- .set_reference(key, model) ⇒ Object
Class Method Details
.load_reference(key, klass) ⇒ Object
Load the model whose key is held in the given string key.
6 7 8 9 |
# File 'lib/authorize/redis/model_reference.rb', line 6 def load_reference(key, klass) reference = klass.db.get(key) reference && klass.load(reference) end |