Reputation: 866
I have an Item model. There is a way to store all the itens (Item.all) in a Redis database? I have tried this:
$redis = Redis::Namespace.new("suggestme", :redis => Redis.new)
$redis.set("itens", Item.all)
But when i retrieve the itens:
$redis.get("itens")
I got a String "#Item::ActiveRecord_Relation:0x007fe399d6e550"
The idea is to store the full array of itens in it
Upvotes: 3
Views: 2278