Skip to content

Instantly share code, notes, and snippets.

@getnashty
Created January 1, 2012 20:00
Show Gist options
  • Save getnashty/1548189 to your computer and use it in GitHub Desktop.
Save getnashty/1548189 to your computer and use it in GitHub Desktop.
def self.fetch_cache(user)
#Make sure the user has companies to cache (based on companies they're a team member of)
if user.profile.team.companies.count > 0
return Rails.cache.fetch(user.profile.team.companies) {
user.profile.team.companies
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment