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
43b89802
Commit
43b89802
authored
Oct 16, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Geo tracking database connection into a concern
parent
9a64ac02
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
21 deletions
+25
-21
app/models/geo/base_fdw.rb
app/models/geo/base_fdw.rb
+2
-10
app/models/geo/base_registry.rb
app/models/geo/base_registry.rb
+2
-10
app/models/geo/fdw/lfs_object.rb
app/models/geo/fdw/lfs_object.rb
+0
-1
ee/app/models/concerns/ee/geo/geo_trackable.rb
ee/app/models/concerns/ee/geo/geo_trackable.rb
+21
-0
No files found.
app/models/geo/base_fdw.rb
View file @
43b89802
class
Geo::BaseFdw
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
if
Gitlab
::
Geo
.
geo_database_configured?
establish_connection
Rails
.
configuration
.
geo_database
end
include
::
EE
::
Geo
::
GeoTrackable
def
self
.
connection
raise
'Geo secondary database is not configured'
unless
Gitlab
::
Geo
.
geo_database_configured?
super
end
self
.
abstract_class
=
true
end
app/models/geo/base_registry.rb
View file @
43b89802
class
Geo::BaseRegistry
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
if
Gitlab
::
Geo
.
geo_database_configured?
establish_connection
Rails
.
configuration
.
geo_database
end
include
::
EE
::
Geo
::
GeoTrackable
def
self
.
connection
raise
'Geo secondary database is not configured'
unless
Gitlab
::
Geo
.
geo_database_configured?
super
end
self
.
abstract_class
=
true
end
app/models/geo/fdw/lfs_object.rb
View file @
43b89802
...
...
@@ -5,4 +5,3 @@ module Geo
end
end
end
ee/app/models/concerns/ee/geo/geo_trackable.rb
0 → 100644
View file @
43b89802
module
EE
module
Geo
module
GeoTrackable
extend
ActiveSupport
::
Concern
included
do
if
::
Gitlab
::
Geo
.
geo_database_configured?
establish_connection
Rails
.
configuration
.
geo_database
end
end
class_methods
do
def
self
.
connection
raise
'Geo secondary database is not configured'
unless
::
Gitlab
::
Geo
.
geo_database_configured?
super
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