From 9626c77a1c77d571de31ac7d6c57146c98b2730c Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sun, 6 Aug 2017 19:28:44 +0200 Subject: [PATCH] Remove `skip_fallback` from post fetcher --- lib/diaspora/fetcher/public.rb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/diaspora/fetcher/public.rb b/lib/diaspora/fetcher/public.rb index 34af2f30e..1a7fbd7ee 100644 --- a/lib/diaspora/fetcher/public.rb +++ b/lib/diaspora/fetcher/public.rb @@ -102,25 +102,16 @@ module Diaspora; module Fetcher; class Public logger.debug "post: #{post.to_s[0..250]}" - # disable some stuff we don't want for bulk inserts - StatusMessage.skip_callback :create, :set_guid - entry = StatusMessage.diaspora_initialize( - :author => @person, - :public => true - ) - entry.assign_attributes( + author: @person, + public: true, guid: post["guid"], text: post["text"], provider_display_name: post["provider_display_name"], created_at: ActiveSupport::TimeZone.new("UTC").parse(post["created_at"]).to_datetime, - interacted_at: ActiveSupport::TimeZone.new("UTC").parse(post["interacted_at"]).to_datetime ) entry.save - # re-enable everything we disabled before - StatusMessage.set_callback :create, :set_guid - end set_fetch_status Public::Status_Processed end