comparison app/models/tweet.rb @ 69:37356e98b784

Ensure options for cache key isn't changed
author nanaya <me@myconan.net>
date Tue, 19 Jan 2016 22:32:08 +0900
parents 1161ad2a4390
children e9a6019a34ea
comparison
equal deleted inserted replaced
68:02b7b07b84b3 69:37356e98b784
1 class Tweet 1 class Tweet
2 def timeline(options = {}) 2 def timeline(options = {})
3 @timeline ||= 3 @timeline ||=
4 Rails.cache.fetch({ :timeline => @twitter_id, :options => options }, :expires_in => 5.minutes) do 4 Rails.cache.fetch({ :timeline => @twitter_id, :options => options.dup }, :expires_in => 5.minutes) do
5 @client.user_timeline(@twitter_id, options) 5 @client.user_timeline(@twitter_id, options)
6 end 6 end
7 end 7 end
8 8
9 def user 9 def user