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