changeset 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 02b7b07b84b3
children 5d61551ad9d6
files app/models/tweet.rb
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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