私はTwitterの宝石を使って、承認後自動的に別のツイッターユーザーを追跡する方法を持っています。これは動作します:Twitterのgem followの方法をレール3.1 app
def follow_us
Twitter.follow("boxfirepress")
end
私はしたいと思いますが、ユーザーがまだ追跡されていないことを確認してください。私は条件文を正しく得ることができない。
私が試した:self.nickname
はOAuthの処理中に撮影し、Twitterのハンドルことになっている
def follow_us
Twitter.follow("boxfirepress") unless Twitter.friendship_exists?("boxfirepress", self.nickname)
end
を。それはデータベースに格納されていますが、正しく読み込まれていない可能性があります。 Authorizations
モデルのafter_save
コールを使用しています。
私も
def follow_us
unless Twitter.friendship_exists?("boxfirepress", self.nickname)
Twitter.follow("boxfirepress")
end
end
を試してみましたしかし、それはどちらか、動作しませんでした。ニックネームの代わりにself.uid
も試しました。