From 4087f4c94a2c4a567388bc58c738e064fbe03451 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 27 Mar 2014 01:12:56 +0400 Subject: [PATCH] #345: rollback changes --- app/models/concerns/feed/user.rb | 2 +- app/models/concerns/git.rb | 4 ++-- app/models/mass_build.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 = [