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
36083b4d
Commit
36083b4d
authored
May 11, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed styling per Rubocop pedantics
parent
443c3aa5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
lib/gitlab/database/migration_helpers.rb
lib/gitlab/database/migration_helpers.rb
+3
-1
spec/lib/gitlab/database/migration_helpers_spec.rb
spec/lib/gitlab/database/migration_helpers_spec.rb
+4
-4
No files found.
lib/gitlab/database/migration_helpers.rb
View file @
36083b4d
...
@@ -119,7 +119,9 @@ module Gitlab
...
@@ -119,7 +119,9 @@ module Gitlab
transaction
do
transaction
do
update_column_in_batches
(
table
,
column
,
default
)
update_column_in_batches
(
table
,
column
,
default
)
end
end
rescue
Exception
=>
error
# We want to rescue _all_ exceptions here, even those that don't inherit
# from StandardError.
rescue
Exception
=>
error
# rubocop: disable all
remove_column
(
table
,
column
)
remove_column
(
table
,
column
)
raise
error
raise
error
...
...
spec/lib/gitlab/database/migration_helpers_spec.rb
View file @
36083b4d
...
@@ -105,9 +105,9 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
...
@@ -105,9 +105,9 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
expect
(
model
).
to
receive
(
:remove_column
).
expect
(
model
).
to
receive
(
:remove_column
).
with
(
:projects
,
:foo
)
with
(
:projects
,
:foo
)
expect
{
expect
do
model
.
add_column_with_default
(
:projects
,
:foo
,
:integer
,
default:
10
)
model
.
add_column_with_default
(
:projects
,
:foo
,
:integer
,
default:
10
)
}
.
to
raise_error
(
RuntimeError
)
end
.
to
raise_error
(
RuntimeError
)
end
end
end
end
...
@@ -115,9 +115,9 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
...
@@ -115,9 +115,9 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
it
'raises RuntimeError'
do
it
'raises RuntimeError'
do
expect
(
model
).
to
receive
(
:transaction_open?
).
and_return
(
true
)
expect
(
model
).
to
receive
(
:transaction_open?
).
and_return
(
true
)
expect
{
expect
do
model
.
add_column_with_default
(
:projects
,
:foo
,
:integer
,
default:
10
)
model
.
add_column_with_default
(
:projects
,
:foo
,
:integer
,
default:
10
)
}
.
to
raise_error
(
RuntimeError
)
end
.
to
raise_error
(
RuntimeError
)
end
end
end
end
end
end
...
...
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