diff options
author | rhenium <re4k@re4k.info> | 2013-05-20 23:56:26 +0900 |
---|---|---|
committer | rhenium <re4k@re4k.info> | 2013-05-20 23:56:26 +0900 |
commit | 43b82c0d5deb0587365d98be599ab03a50c79fa4 (patch) | |
tree | 9579d89477584834e428e51436e603464bb07054 /app/models/tweet.rb | |
parent | 0830b385775b17479100021e956fa14df8dcb4f9 (diff) | |
download | aclog-43b82c0d5deb0587365d98be599ab03a50c79fa4.tar.gz |
remove stolen_tweet model
Diffstat (limited to 'app/models/tweet.rb')
-rw-r--r-- | app/models/tweet.rb | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/app/models/tweet.rb b/app/models/tweet.rb index 5978d26..e8fe41b 100644 --- a/app/models/tweet.rb +++ b/app/models/tweet.rb @@ -2,15 +2,12 @@ class Tweet < ActiveRecord::Base belongs_to :user has_many :favorites, -> { order("favorites.id") }, dependent: :delete_all has_many :retweets, -> { order("retweets.id") }, dependent: :delete_all - has_one :stolen_tweet, ->{ includes(:original) }, dependent: :delete has_many :favoriters, -> {order("favorites.id") }, through: :favorites, source: :user has_many :retweeters, -> { order("retweets.id") }, through: :retweets, source: :user - has_one :original, through: :stolen_tweet, source: :original scope :recent, -> { where("tweets.tweeted_at > ?", Time.zone.now - 3.days) } scope :reacted, -> {where("tweets.favorites_count > 0 OR tweets.retweets_count > 0") } - scope :original, -> { includes(:stolen_tweet).where(stolen_tweets: {tweet_id: nil}) } scope :not_protected, -> { includes(:user).where(users: {protected: false}) } scope :max_id, -> id { where("tweets.id <= ?", id.to_i) if id } scope :since_id, -> id { where("tweets.id > ?", id.to_i) if id } |