Files

Class Index [+]

Quicksearch

UbiquoDesign::CacheExpiration::ActiveRecord::InstanceMethods

Public Class Methods

included(klass) click to toggle source

(Not documented)

    # File vendor/plugins/ubiquo_design/lib/ubiquo_design/cache_expiration.rb, line 16
16:         def self.included(klass)
17:           klass.alias_method_chain :create, :cache_expiration
18:           klass.alias_method_chain :update, :cache_expiration
19:           klass.alias_method_chain :destroy, :cache_expiration
20:           attr_accessor :cache_expiration_denied
21:         end

Public Instance Methods

create_with_cache_expiration() click to toggle source

(Not documented)

    # File vendor/plugins/ubiquo_design/lib/ubiquo_design/cache_expiration.rb, line 29
29:         def create_with_cache_expiration
30:           expire_by_model
31:           create_without_cache_expiration
32:         end
destroy_with_cache_expiration() click to toggle source

(Not documented)

    # File vendor/plugins/ubiquo_design/lib/ubiquo_design/cache_expiration.rb, line 39
39:         def destroy_with_cache_expiration
40:           expire_by_model
41:           destroy_without_cache_expiration
42:         end
update_with_cache_expiration() click to toggle source

(Not documented)

    # File vendor/plugins/ubiquo_design/lib/ubiquo_design/cache_expiration.rb, line 34
34:         def update_with_cache_expiration
35:           expire_by_model
36:           update_without_cache_expiration
37:         end
without_cache_expiration() {|| ...} click to toggle source

(Not documented)

    # File vendor/plugins/ubiquo_design/lib/ubiquo_design/cache_expiration.rb, line 23
23:         def without_cache_expiration
24:           self.cache_expiration_denied = true
25:           yield
26:           self.cache_expiration_denied = false
27:         end

Protected Instance Methods

expire_by_model() click to toggle source

(Not documented)

    # File vendor/plugins/ubiquo_design/lib/ubiquo_design/cache_expiration.rb, line 45
45:         def expire_by_model
46:           return if self.cache_expiration_denied.present?
47:           expirable_widgets, version_widgets = UbiquoDesign::CachePolicies.get_by_model(self, @cache_policy_context)
48:           expirable_widgets.each do |key|
49:             Widget.class_by_key(key).all.each do |widget|
50:               UbiquoDesign.cache_manager.expire(widget,
51:                 :scope => self,
52:                 :policy_context => @cache_policy_context,
53:                 :current_model => self.class.name)
54:             end
55:           end
56:           version_widgets.each do |key|
57:             start = Time.zone.now
58:             key.to_s.classify.constantize.update_all('version = (version +1)')
59:             Rails.logger.debug "Version cache #{key}, from #{self.id} - #{self.class.name}, in #{(Time.zone.now - start)/1000}"
60:           end
61:           # TODO if the model contains one of: publication_date, published_at, then expire at that time
62:         end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.