Commit b995502d authored by James Lopez's avatar James Lopez

fix MRs, added project restorer spec

parent 54e18d28
...@@ -99,7 +99,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -99,7 +99,7 @@ class MergeRequest < ActiveRecord::Base
validates :merge_user, presence: true, if: :merge_when_pipeline_succeeds?, unless: :importing? validates :merge_user, presence: true, if: :merge_when_pipeline_succeeds?, unless: :importing?
validate :validate_branches, unless: [:allow_broken, :importing?, :closed_without_fork?] validate :validate_branches, unless: [:allow_broken, :importing?, :closed_without_fork?]
validate :validate_fork, unless: :closed_without_fork? validate :validate_fork, unless: :closed_without_fork?
validate :validate_approvals_before_merge validate :validate_approvals_before_merge, unless: :importing?
validate :validate_target_project, on: :create validate :validate_target_project, on: :create
scope :by_source_or_target_branch, ->(branch_name) do scope :by_source_or_target_branch, ->(branch_name) do
......
...@@ -8,7 +8,6 @@ module EE ...@@ -8,7 +8,6 @@ module EE
prepended do prepended do
include Elastic::ProjectsSearch include Elastic::ProjectsSearch
include Importable
prepend GeoAwareAvatar prepend GeoAwareAvatar
prepend ImportStatusStateMachine prepend ImportStatusStateMachine
...@@ -54,7 +53,7 @@ module EE ...@@ -54,7 +53,7 @@ module EE
validates :repository_size_limit, validates :repository_size_limit,
numericality: { only_integer: true, greater_than_or_equal_to: 0, allow_nil: true } numericality: { only_integer: true, greater_than_or_equal_to: 0, allow_nil: true }
validates :approvals_before_merge, numericality: true, allow_blank: true, unless: :importing? validates :approvals_before_merge, numericality: true, allow_blank: true
accepts_nested_attributes_for :remote_mirrors, accepts_nested_attributes_for :remote_mirrors,
allow_destroy: true, allow_destroy: true,
......
...@@ -2967,7 +2967,8 @@ ...@@ -2967,7 +2967,8 @@
"action": 1, "action": 1,
"author_id": 1 "author_id": 1
} }
] ],
"approvals_before_merge": 1
}, },
{ {
"id": 26, "id": 26,
......
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