diff 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
line wrap: on
line diff
--- a/app/models/tweet.rb	Tue Dec 01 01:39:00 2015 +0900
+++ b/app/models/tweet.rb	Tue Jan 19 22:32:08 2016 +0900
@@ -1,7 +1,7 @@
 class Tweet
   def timeline(options = {})
     @timeline ||=
-      Rails.cache.fetch({ :timeline => @twitter_id, :options => options }, :expires_in => 5.minutes) do
+      Rails.cache.fetch({ :timeline => @twitter_id, :options => options.dup }, :expires_in => 5.minutes) do
         @client.user_timeline(@twitter_id, options)
       end
   end