Skip to content

Instantly share code, notes, and snippets.

@smartcode
Created December 11, 2011 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smartcode/1463406 to your computer and use it in GitHub Desktop.
Save smartcode/1463406 to your computer and use it in GitHub Desktop.
def around_api_response(api_template)
Rails.cache.fetch("api_response_#{self.class.to_s}_#{id}_#{api_template.to_s}", :expires_in => 1.hour) do
yield
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment