Module: LegacyBrokerHelper
- Included in:
- ApplicationsController, CartridgesController, EmbCartController, GroupInstance, LegacyBrokerController, RestApplication, RestApplication10, RestApplication12, RestDomain, RestDomain10, RestGear
- Defined in:
- app/helpers/legacy_broker_helper.rb
Instance Method Summary collapse
Instance Method Details
#get_cached(key, opts = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/legacy_broker_helper.rb', line 2 def get_cached(key, opts={}) unless Rails.configuration.action_controller.perform_caching if block_given? return yield end end val = Rails.cache.read(key) unless val if block_given? val = yield if val Rails.cache.write(key, val, opts) end end end return val end |