lib/looksist.rb in looksist-0.0.1 vs lib/looksist.rb in looksist-0.0.2
- old
+ new
@@ -1,6 +1,8 @@
require 'looksist/version'
+require 'looksist/redis_service'
+require 'looksist/hashed'
module Looksist
extend ActiveSupport::Concern
class << self;
attr_accessor :lookup_store_client, :driver
@@ -17,10 +19,10 @@
self.lookup_attributes ||= []
if what.is_a? Array
what.each do |method_name|
define_method(method_name) do
key = [bucket, '/', self.send(using).try(:to_s)].join('')
- JSON.parse(send(:memoized, key))[method_name.to_s]
+ JSON.parse(send(:memoized, key) || '{}')[method_name.to_s]
end
self.lookup_attributes << method_name
end
else
define_method(what) do