|
|
|
@ -66,8 +66,12 @@ namespace :sync do
|
|
|
|
|
message_detail.update_columns(created_at: rand_created_on, updated_at: rand_created_on)
|
|
|
|
|
if replies.present?
|
|
|
|
|
replies.each do |reply|
|
|
|
|
|
reply_time = smaller_time(rand_created_on, start_time, end_time)
|
|
|
|
|
puts("666")
|
|
|
|
|
puts("reply id si #{reply.id}")
|
|
|
|
|
reply_time = random_time(start_time, end_time)
|
|
|
|
|
while reply_time > rand_created_on
|
|
|
|
|
reply_time = random_time(start_time, end_time)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
reply_message = Message.create!(board_id: board_id.to_i, author_id: reply.user_id, parent_id: new_message.id, root_id: message_id)
|
|
|
|
|
reply_message.update_columns(created_on: reply_time, updated_on: reply_time)
|
|
|
|
|
reply_message_detail = MessageDetail.create!(message_id: reply_message.id, content: reply.try(:content))
|
|
|
|
|