Only define Impressionable::ClassMethods::DEFAULT_CACHE when undefined
Current behavior causes unnecessary warning messages to be issued when using Impressionist with application preloaders such as spring.
This commit is contained in:
parent
a974bd85b3
commit
e3f86c8051
|
@ -5,7 +5,13 @@ module Impressionist
|
|||
module ClassMethods
|
||||
attr_accessor :impressionist_cache_options
|
||||
|
||||
DEFAULT_CACHE = { :counter_cache => false, :column_name => :impressions_count, :unique => false }
|
||||
unless defined?(DEFAULT_CACHE)
|
||||
DEFAULT_CACHE = {
|
||||
:counter_cache => false,
|
||||
:column_name => :impressions_count,
|
||||
:unique => false
|
||||
}
|
||||
end
|
||||
|
||||
def impressionist_counter_cache_options
|
||||
@impressionist_cache_options ||= {}
|
||||
|
|
Loading…
Reference in New Issue