diff --git a/app/models/concerns/feed/user.rb b/app/models/concerns/feed/user.rb index a6cccb90a..66b7ff111 100644 --- a/app/models/concerns/feed/user.rb +++ b/app/models/concerns/feed/user.rb @@ -2,7 +2,7 @@ module Feed::User extend ActiveSupport::Concern included do - after_create :new_user_notification + after_commit :new_user_notification, on: :create end private diff --git a/app/models/concerns/git.rb b/app/models/concerns/git.rb index f8e97b6e4..3565ea25e 100644 --- a/app/models/concerns/git.rb +++ b/app/models/concerns/git.rb @@ -11,8 +11,8 @@ module Git validates_attachment_content_type :srpm, content_type: ['application/octet-stream', "application/x-rpm", "application/x-redhat-package-manager"], message: I18n.t('layout.invalid_content_type') after_create :create_git_repo - after_create {|p| p.fork_git_repo unless p.is_root?} # later with resque - after_create {|p| p.import_attached_srpm if p.srpm?} # later with resque # should be after create_git_repo + after_commit(on: :create) {|p| p.fork_git_repo unless p.is_root?} # later with resque + after_commit(on: :create) {|p| p.import_attached_srpm if p.srpm?} # later with resque # should be after create_git_repo after_destroy :destroy_git_repo # after_rollback -> { destroy_git_repo rescue true if new_record? } diff --git a/app/models/mass_build.rb b/app/models/mass_build.rb index 965ca8f22..653ff9c60 100644 --- a/app/models/mass_build.rb +++ b/app/models/mass_build.rb @@ -19,7 +19,7 @@ class MassBuild < ActiveRecord::Base validates :projects_list, length: {maximum: 500_000}, presence: true validates_inclusion_of :auto_publish, :increase_release_tag, in: [true, false] - after_create :build_all + after_commit :build_all, on: :create before_validation :set_data, on: :create COUNT_STATUSES = [