Sha256: 1df2cf3449bfdb6cb907b94e65228a92be3a53a760493e852db266042e9a3c00
Contents?: true
Size: 596 Bytes
Versions: 38
Compression:
Stored size: 596 Bytes
Contents
class Tweet < ActiveRecord::Base belongs_to :account def self.create_from_tweet(account, s) tweet = account.tweets.find_or_initialize_by_twitter_id(s.id) tweet.body = s.text tweet.occurred_at = s.created_at %w[truncated favorited in_reply_to_status_id in_reply_to_user_id source].each do |m| tweet.send("#{m}=", s.send(m)) end %w[id followers_count name screen_name location description profile_image_url url protected].each do |m| tweet.send("user_#{m}=", s.user.send(m)) end tweet.save! tweet end end
Version data entries
38 entries across 38 versions & 15 rubygems