From bb66b973a6335f46f04ec513bc26280b9b8a111b Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 11 Jun 2016 15:45:46 +0200 Subject: [PATCH] only posts do have reshares --- app/models/post.rb | 5 +++++ lib/diaspora/shareable.rb | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index 532b4784a..6eda1fbe0 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -131,6 +131,11 @@ class Post < ActiveRecord::Base ############# + # @return [Integer] + def update_reshares_counter + self.class.where(id: id).update_all(reshares_count: reshares.count) + end + def self.diaspora_initialize(params) new(params.to_hash.stringify_keys.slice(*column_names, "author")) end diff --git a/lib/diaspora/shareable.rb b/lib/diaspora/shareable.rb index 8c37ab522..84193951a 100644 --- a/lib/diaspora/shareable.rb +++ b/lib/diaspora/shareable.rb @@ -42,11 +42,6 @@ module Diaspora ShareVisibility.batch_import(recipient_user_ids, self) end - # @return [Integer] - def update_reshares_counter - self.class.where(id: id).update_all(reshares_count: reshares.count) - end - def diaspora_handle=(author_handle) self.author = Person.where(diaspora_handle: author_handle).first end