lib/lookup_by/cache.rb in lookup_by-0.6.0 vs lib/lookup_by/cache.rb in lookup_by-0.7.0
- old
+ new
@@ -23,9 +23,11 @@
case options[:cache]
when true
@type = :all
@read ||= false
+
+ raise ArgumentError, "`#{@klass}.lookup_by :#{@field}` Should be `cache: true` or `cache: N, find_or_create: true`" if @write
when ::Integer
raise ArgumentError, "`#{@klass}.lookup_by :#{@field}` options[:find] must be true when caching N" if @read == false
@type = :lru
@limit = options[:cache]