Fix after_create to after_commit

This commit is contained in:
Ivan Zotov 2014-01-14 22:35:29 +04:00
parent 42f790fa13
commit a4ce6e267a
9 changed files with 9 additions and 9 deletions

View file

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

View file

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

View file

@ -13,7 +13,7 @@ class Like < Federated::Relayable
end
end
after_create do
after_commit :on => :create do
self.parent.update_likes_counter
end

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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