only posts do have reshares

This commit is contained in:
Benjamin Neff 2016-06-11 15:45:46 +02:00
parent 0e6446d05f
commit bb66b973a6
2 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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