Commit a4ce6e26 authored by Ivan Zotov's avatar Ivan Zotov

Fix after_create to after_commit

parent 42f790fa
......@@ -7,7 +7,7 @@ class AccountDeletion < ActiveRecord::Base
belongs_to :person
after_create :queue_delete_account
after_commit :queue_delete_account, :on => :create
xml_name :account_deletion
xml_attr :diaspora_handle
......
......@@ -41,7 +41,7 @@ class Comment < ActiveRecord::Base
self.post.touch
end
after_create do
after_commit :on => :create do
self.parent.update_comments_counter
end
......
......@@ -13,7 +13,7 @@ class Like < Federated::Relayable
end
end
after_create do
after_commit :on => :create do
self.parent.update_likes_counter
end
......
......@@ -17,7 +17,7 @@ class Message < ActiveRecord::Base
validates :text, :presence => true
validate :participant_of_parent_conversation
after_create do
after_commit :on => :create do
#sign comment as commenter
self.author_signature = self.sign_with_key(self.author.owner.encryption_key) if self.author.owner
......
......@@ -46,7 +46,7 @@ class Photo < ActiveRecord::Base
before_destroy :ensure_user_picture
after_destroy :clear_empty_status_message
after_create do
after_commit :on => :create do
queue_processing_job if self.author.local?
end
......
......@@ -26,7 +26,7 @@ class Post < ActiveRecord::Base
belongs_to :o_embed_cache
belongs_to :open_graph_cache
after_create do
after_commit :on => :create do
self.touch(:interacted_at)
end
......
......@@ -17,7 +17,7 @@ class Reshare < Post
self.public = true
end
after_create do
after_commit :on => :create do
self.root.update_reshares_counter
end
......
......@@ -34,7 +34,7 @@ class StatusMessage < Post
before_create :filter_mentions
after_create :create_mentions
after_create :queue_gather_oembed_data, :if => :contains_oembed_url_in_text?
after_commit :queue_gather_oembed_data, :on => :create, :if => :contains_oembed_url_in_text?
after_commit :queue_gather_open_graph_data, :on => :create, :if => :contains_open_graph_url_in_text?
#scopes
......
......@@ -20,7 +20,7 @@ module Diaspora
delegate :public?, to: :parent
delegate :author, :diaspora_handle, to: :parent, prefix: true
after_create do
after_commit :on => :create do
parent.touch(:interacted_at) if parent.respond_to?(:interacted_at)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment