aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/tweet.rb
diff options
context:
space:
mode:
authorRhenium <rhenium@rhe.jp>2013-11-16 20:13:12 +0900
committerRhenium <rhenium@rhe.jp>2013-11-16 20:13:12 +0900
commit5e3f53524fbb40132a8782a8573c4aadf3beb190 (patch)
treeec9a4a6d030b59592fa023e0ef611e2fdc49e535 /app/models/tweet.rb
parente6836466aeca4a2bb7fbf37e76aab7dd4e77ff7a (diff)
downloadaclog-5e3f53524fbb40132a8782a8573c4aadf3beb190.tar.gz
remover user's most favorited/retweeted
Diffstat (limited to 'app/models/tweet.rb')
-rw-r--r--app/models/tweet.rb19
1 files changed, 0 insertions, 19 deletions
diff --git a/app/models/tweet.rb b/app/models/tweet.rb
index c784612..112fb27 100644
--- a/app/models/tweet.rb
+++ b/app/models/tweet.rb
@@ -53,10 +53,6 @@ class Tweet < ActiveRecord::Base
ret = ret.max_id(params[:max_id]).since_id(params[:since_id])
end
- if options[:cache] && options[:cache] > 0
- ret = ret.cache_list(options[:cache])
- end
-
ret
end
@@ -166,20 +162,5 @@ class Tweet < ActiveRecord::Base
tweets[:text].__send__(positive ? :matches : :does_not_match, "%#{search_text}%")
end
end
-
- def self.cache_list(expires_in)
- key = "tweets/ids/#{Digest::MD5.hexdigest(current_scope.to_sql)}"
- ids = Rails.cache.read(key)
- unless ids
- ids = current_scope.pluck(:id)
- Rails.cache.write(key, ids, expires_in: expires_in)
- end
- m = unscoped.where(id: ids)
- if ids.size > 0
- m.order("CASE tweets.id #{ids.each_with_index.map {|m, i| "WHEN #{m} THEN #{i}" }.join(" ")} END")
- else
- m
- end
- end
end