aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/tweet.rb
diff options
context:
space:
mode:
authorRhenium <rhenium@rhe.jp>2014-01-31 22:03:09 +0900
committerRhenium <rhenium@rhe.jp>2014-01-31 22:03:09 +0900
commitd0edfd177f1188a2d3b73473673b64340f3a9351 (patch)
treedff34ed02188af313b071ca4650f91e24cbcdef9 /app/models/tweet.rb
parent7c8a7d1459cfd6519dfd66884307c808ee631bc8 (diff)
downloadaclog-d0edfd177f1188a2d3b73473673b64340f3a9351.tar.gz
add threshold buttons to timeline (timeline_path and user_timeline_path) pages
Diffstat (limited to 'app/models/tweet.rb')
-rw-r--r--app/models/tweet.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tweet.rb b/app/models/tweet.rb
index 0dfe47a..c9c9c14 100644
--- a/app/models/tweet.rb
+++ b/app/models/tweet.rb
@@ -12,7 +12,7 @@ class Tweet < ActiveRecord::Base
has_many :retweeters, -> { order("retweets.id") }, through: :retweets, source: :user
scope :recent, ->(days = 3) { where("tweets.id > ?", snowflake_min(Time.zone.now - days.days)) }
- scope :reacted, -> { where.not(reactions_count: 0) }
+ scope :reacted, ->(count = nil) { where("reactions_count >= ?", [count.to_i, 1].max) }
scope :not_protected, -> { includes(:user).where(users: {protected: false}) }
scope :max_id, -> id { where("tweets.id <= ?", id.to_i) if id }