app/models/concerns/twitter_user/association_builder.rb
# Each process takes a few seconds if the relation has thousands of objects.
Each process takes a few seconds if the relation has thousands of objects.
Each process takes a few seconds if the relation has thousands of objects .
def build_other_relations(relations)
    user_timeline, mentions_timeline, _favorites = %i(user_timeline mentions_timeline favorites).map { |key| relations[key] }
    if (mentions_timeline.nil? || mentions_timeline.empty?) && relations.has_key?(:search)
      mentions_timeline = relations[:search].reject {|status| uid == status[:user][:id] || status[:text].start_with?("RT @#{screen_name}")}
    end
    user_timeline.each { |status| statuses.build(TwitterDB::Status.attrs_by(twitter_user: self, status: status)) } if user_timeline&.any?
    mentions_timeline.each { |status| mentions.build(TwitterDB::Mention.attrs_by(twitter_user: self, status: status)) } if mentions_timeline&.any?
    _favorites.each { |status| favorites.build(TwitterDB::Favorite.attrs_by(twitter_user: self, status: status)) } if _favorites&.any?
  end
def build_other_relations ( relations ) user_timeline , mentions_timeline , _favorites = %i( user_timeline mentions_timeline favorites ) . map { | key | relations [ key ] } if ( mentions_timeline . nil? || mentions_timeline . empty? ) && relations . has_key? ( :search ) mentions_timeline = relations [ :search ] . reject { | status | uid == status [ :user ] [ :id ] || status [ :text ] . start_with? ( "RT @#{screen_name}" ) } end user_timeline . each { | status | statuses . build ( TwitterDB :: Status . attrs_by ( twitter_user : self , status : status ) ) } if user_timeline &. any? mentions_timeline . each { | status | mentions . build ( TwitterDB :: Mention . attrs_by ( twitter_user : self , status : status ) ) } if mentions_timeline &. any? _favorites . each { | status | favorites . build ( TwitterDB :: Favorite . attrs_by ( twitter_user : self , status : status ) ) } if _favorites &. any? end
Each process takes a few seconds if the relation has thousands of objects.
Each process takes a few seconds if the relation has thousands of objects .
relations
<not_specific>