Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9671a67a
Commit
9671a67a
authored
Feb 14, 2019
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken specs
parent
d4a5d8d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
app/models/concerns/issuable_states.rb
app/models/concerns/issuable_states.rb
+9
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
db/migrate/20190211131150_add_state_id_to_issuables.rb
db/migrate/20190211131150_add_state_id_to_issuables.rb
+2
-0
No files found.
app/models/concerns/issuable_states.rb
View file @
9671a67a
# frozen_string_literal: true
module
IssuableStates
extend
ActiveSupport
::
Concern
# The state:string column is being migrated to state_id:integer column
# This is a temporary hook to populate state_id column with new values
# and
can
be removed after the state column is removed.
# and
should
be removed after the state column is removed.
# Check https://gitlab.com/gitlab-org/gitlab-ce/issues/51789 for more information
included
do
before_save
:set_state_id
...
...
@@ -12,6 +14,12 @@ module IssuableStates
def
set_state_id
return
if
state
.
nil?
||
state
.
empty?
# Needed to prevent breaking some migration specs that
# rollback database to a point where state_id does not exist.
# We can use this guard clause for now since this file will should
# be removed in the next release.
return
unless
self
.
respond_to?
(
:state_id
)
states_hash
=
self
.
class
.
available_states
self
.
state_id
=
states_hash
[
state
]
...
...
app/models/merge_request.rb
View file @
9671a67a
...
...
@@ -194,7 +194,7 @@ class MergeRequest < ActiveRecord::Base
end
def
self
.
available_states
@states
||=
super
.
merge
(
merged:
3
,
locked:
4
)
@
available_
states
||=
super
.
merge
(
merged:
3
,
locked:
4
)
end
def
rebase_in_progress?
...
...
db/migrate/20190211131150_add_state_id_to_issuables.rb
View file @
9671a67a
# frozen_string_literal: true
class
AddStateIdToIssuables
<
ActiveRecord
::
Migration
[
5.0
]
include
Gitlab
::
Database
::
MigrationHelpers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment