mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-09 05:15:53 +10:00
15 lines
412 B
Ruby
15 lines
412 B
Ruby
namespace :create do
|
|
|
|
desc 'create timeline sources for share and like events'
|
|
task :create_timeline_source => :environment do
|
|
ShareInstance.all.each do |instance|
|
|
instance.user.timeline_sources.create! post_id: instance.sharable_id, action_type: 'share'
|
|
end
|
|
|
|
Like.all.each do |like|
|
|
like.user.timeline_sources.create! post_id: like.likable_id, action_type: 'like'
|
|
end
|
|
|
|
end
|
|
|
|
end |