Merge pull request #136 from geoffharcourt/geoffharcourt-issue_135

Only define Impressionable::ClassMethods::DEFAULT_CACHE when undefined
This commit is contained in:
Antonio C Nalesso Moreira 2013-12-31 13:19:21 -08:00
commit 71b081c749
1 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,11 @@ module Impressionist
module ClassMethods module ClassMethods
attr_accessor :impressionist_cache_options attr_accessor :impressionist_cache_options
DEFAULT_CACHE = { :counter_cache => false, :column_name => :impressions_count, :unique => false } DEFAULT_CACHE ||= {
:counter_cache => false,
:column_name => :impressions_count,
:unique => false
}
def impressionist_counter_cache_options def impressionist_counter_cache_options
@impressionist_cache_options ||= {} @impressionist_cache_options ||= {}