Method: OneTouch::AsFavorHost::ClassMethods#cached_favor_to
- Defined in:
- lib/one_touch/models/as_favor_host.rb
#cached_favor_to(favorable, context = default_context_in_host) ⇒ Object
Programmer Doc
This method is not used in otherwhere
33 34 35 36 37 38 |
# File 'lib/one_touch/models/as_favor_host.rb', line 33 def cached_favor_to(favorable,context=default_context_in_host) key = "#{self.name}_favor_to_#{favorable.class.name}_#{favorable.id}_#{context}" Rails.cache.fetch key do favor_to(favorable, context) end end |