Class: Spree::Tracker
- Defined in:
- app/models/spree/tracker.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Methods included from Preferences::Preferable
#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Class Method Details
.current ⇒ Object
7 8 9 10 11 12 |
# File 'app/models/spree/tracker.rb', line 7 def self.current tracker = Rails.cache.fetch("current_tracker") do where(active: true).first end tracker.analytics_id.present? ? tracker : nil if tracker end |
Instance Method Details
#clear_cache ⇒ Object
15 16 17 |
# File 'app/models/spree/tracker.rb', line 15 def clear_cache Rails.cache.delete("current_tracker") end |