Module: Cell::Caching::Notifications

Defined in:
lib/cell/caching/notification.rb

Instance Method Summary collapse

Instance Method Details

#fetch_from_cache_for(key, options) ⇒ Object


4
5
6
7
8
9
10
11
12
# File 'lib/cell/caching/notification.rb', line 4

def fetch_from_cache_for(key, options)
  ActiveSupport::Notifications.instrument('read_fragment.cells', :key => key) do
    cache_store.fetch(key, options) do
      ActiveSupport::Notifications.instrument('write_fragment.cells', :key => key) do
        yield
      end
    end
  end
end