Skip to content

Commit

Permalink
Change after_create to after_commit for parse_domains
Browse files Browse the repository at this point in the history
  • Loading branch information
Undo1 committed Jan 2, 2018
1 parent 07b1a12 commit a0ea5a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Post < ApplicationRecord
# WARNING: This is *very* slow without a limit - use Post.undeleted.limit(n) where possible.
scope(:undeleted, -> { left_joins(:deletion_logs).where(deletion_logs: { id: nil }) })

after_create :parse_domains
after_commit :parse_domains, on: :create

after_create do
ActionCable.server.broadcast 'posts_realtime', row: PostsController.render(locals: { post: Post.last }, partial: 'post').html_safe
Expand Down

0 comments on commit a0ea5a8

Please sign in to comment.