Skip to content

Commit

Permalink
pluck is a nested array 🤦
Browse files Browse the repository at this point in the history
  • Loading branch information
jtomchak committed Nov 14, 2023
1 parent 4dc1d57 commit ad5c37d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/lib/channel_feed_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def batch_to_feed(channel_id, status_ids)
# keeping both id and account_id of each status for breadcrumbs
# we serialize it to json to store
def batch_to_threshold(channel_id, statuses)
# statuses = status_ids.zip(status_ids)
Rails.logger.debug { "CHANNEL Statuses:: #{statues.inspect}" }
batch_statuses = statuses.map { |s| [s[:id], s.to_json] }

perform_push_to_threshold(channel_id, batch_statuses)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def update_engagement_threshold_channel_feeds!
filtered_channels = Mammoth::Channels.new.filter_statuses_with_threshold
filtered_channels.each do |channel|
Rails.logger.debug { "FILTER CHANNEL:: #{channel} \n" }
channel_feed_manager.batch_to_threshold(channel[:id], channel[:statuses].pluck(:id, :account_id))
channel_feed_manager.batch_to_threshold(channel[:id], channel[:statuses].pluck(:id, :account_id).map { |id, account_id| { id: id, account_id: account_id } })
end
end

Expand Down

0 comments on commit ad5c37d

Please sign in to comment.