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
0ae41e7d
Commit
0ae41e7d
authored
Mar 10, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Database Cleaner for Geo database when database file is available
parent
2785b205
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
app/models/geo/base_registry.rb
app/models/geo/base_registry.rb
+1
-1
spec/support/db_cleaner.rb
spec/support/db_cleaner.rb
+4
-1
No files found.
app/models/geo/base_registry.rb
View file @
0ae41e7d
class
Geo::BaseRegistry
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
if
Gitlab
::
Geo
.
secondary?
||
Rails
.
env
.
test?
if
Gitlab
::
Geo
.
secondary?
||
(
Rails
.
env
.
test?
&&
Rails
.
configuration
.
respond_to?
(
:geo_database
))
establish_connection
Rails
.
configuration
.
geo_database
end
end
spec/support/db_cleaner.rb
View file @
0ae41e7d
...
...
@@ -30,7 +30,10 @@ RSpec.configure do |config|
end
def
setup_database_cleaner
DatabaseCleaner
[
:active_record
,
{
connection:
Geo
::
BaseRegistry
}]
if
Rails
.
configuration
.
respond_to?
(
:geo_database
)
DatabaseCleaner
[
:active_record
,
{
connection:
Geo
::
BaseRegistry
}]
end
DatabaseCleaner
[
:active_record
,
{
connection:
ActiveRecord
::
Base
}]
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