only posts do have reshares
This commit is contained in:
parent
0e6446d05f
commit
bb66b973a6
2 changed files with 5 additions and 5 deletions
|
|
@ -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)
|
def self.diaspora_initialize(params)
|
||||||
new(params.to_hash.stringify_keys.slice(*column_names, "author"))
|
new(params.to_hash.stringify_keys.slice(*column_names, "author"))
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -42,11 +42,6 @@ module Diaspora
|
||||||
ShareVisibility.batch_import(recipient_user_ids, self)
|
ShareVisibility.batch_import(recipient_user_ids, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Integer]
|
|
||||||
def update_reshares_counter
|
|
||||||
self.class.where(id: id).update_all(reshares_count: reshares.count)
|
|
||||||
end
|
|
||||||
|
|
||||||
def diaspora_handle=(author_handle)
|
def diaspora_handle=(author_handle)
|
||||||
self.author = Person.where(diaspora_handle: author_handle).first
|
self.author = Person.where(diaspora_handle: author_handle).first
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue