diff options
author | Rhenium <rhenium@rhe.jp> | 2013-07-30 05:42:23 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2013-07-30 05:42:23 +0900 |
commit | d1ed18861838e3bb8e42b9f17818e1fb7f9b3d44 (patch) | |
tree | 714050bd75d03134796560e83eb0256947771b8b /app/models | |
parent | e0d1ab3a78544053e57970c57c758d1779db3ba4 (diff) | |
download | aclog-d1ed18861838e3bb8e42b9f17818e1fb7f9b3d44.tar.gz |
fix specs
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/account.rb | 15 | ||||
-rw-r--r-- | app/models/favorite.rb | 8 | ||||
-rw-r--r-- | app/models/retweet.rb | 9 |
3 files changed, 1 insertions, 31 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index a229f20..1ccda93 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -55,20 +55,7 @@ class Account < ActiveRecord::Base end def import_favorites(id) - result = client.status_activity(id) - - # favs ユーザー一覧回収 - Favorite.from_tweet_object(result) - - # favs ユーザー回収 - client.users(result.favoriters).each do |u| - User.from_user_object(u) - end - - # rts 回収・RTのステータスIDを取得する必要がある - client.retweets(id, count: 100).each do |status| - Retweet.from_tweet_object(status) - end + raise Exception, "not implemented" end def following?(target_user_id) diff --git a/app/models/favorite.rb b/app/models/favorite.rb index 8467927..edf50a3 100644 --- a/app/models/favorite.rb +++ b/app/models/favorite.rb @@ -18,14 +18,6 @@ class Favorite < ActiveRecord::Base return nil end - def self.from_tweet_object(tweet_object) - if tweet_object.favoriters.is_a? Array - tweet_object.favoriters.reverse.map do |uid| - from_hash(user_id: uid, tweet_id: tweet_object.id) - end - end - end - def self.delete_from_receiver(msg) where(tweet_id: msg["tweet"]["id"], user_id: msg["user"]["id"]).destroy_all end diff --git a/app/models/retweet.rb b/app/models/retweet.rb index 0a0e090..a39e659 100644 --- a/app/models/retweet.rb +++ b/app/models/retweet.rb @@ -17,13 +17,4 @@ class Retweet < ActiveRecord::Base logger.error("Unknown error while inserting retweet: #{e.class}: #{e.message}/#{e.backtrace.join("\n")}") return nil end - - def self.from_tweet_object(status) - User.from_user_object(status.user) - # Tweet.from_tweet_object(status.retweeted_status) - # TODO: URL format... - from_hash(id: status.id, - user_id: status.user.id, - tweet_id: status.retweeted_status.id) - end end |