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
f23dc096
Commit
f23dc096
authored
Jul 01, 2021
by
Zhu Shung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add route patch for JH and modify country
parent
f5a67298
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
config/routes.rb
config/routes.rb
+4
-0
ee/lib/world.rb
ee/lib/world.rb
+2
-1
ee/spec/controllers/countries_controller_spec.rb
ee/spec/controllers/countries_controller_spec.rb
+1
-0
No files found.
config/routes.rb
View file @
f23dc096
...
...
@@ -184,6 +184,10 @@ Rails.application.routes.draw do
resources
:survey_responses
,
only: :index
end
Gitlab
.
jh
do
draw
:province
end
if
ENV
[
'GITLAB_CHAOS_SECRET'
]
||
Rails
.
env
.
development?
||
Rails
.
env
.
test?
resource
:chaos
,
only:
[]
do
get
:leakmem
...
...
ee/lib/world.rb
View file @
f23dc096
...
...
@@ -5,6 +5,7 @@ module World
extend
self
DENYLIST
=
[
'Iran (Islamic Republic of)'
,
'Sudan'
,
'Syrian Arab Republic'
,
'Korea (Democratic People\'s Republic of)'
,
'Cuba'
].
freeze
JH_MARKET
=
[
'China'
,
'Hong Kong'
,
'Macao'
].
freeze
def
countries_for_select
strong_memoize
(
:countries_for_select
)
{
all_countries
.
sort_by
(
&
:name
).
map
{
|
c
|
[
c
.
name
,
c
.
alpha2
]
}
}
...
...
@@ -23,7 +24,7 @@ module World
end
def
all_countries
strong_memoize
(
:all_countries
)
{
ISO3166
::
Country
.
all
.
reject
{
|
item
|
DENYLIST
.
include?
(
item
.
name
)
}
}
strong_memoize
(
:all_countries
)
{
ISO3166
::
Country
.
all
.
reject
{
|
item
|
DENYLIST
.
include?
(
item
.
name
)
||
JH_MARKET
.
include?
(
item
.
name
)
}
}
end
def
alpha3_from_alpha2
(
alpha2
)
...
...
ee/spec/controllers/countries_controller_spec.rb
View file @
f23dc096
...
...
@@ -20,6 +20,7 @@ RSpec.describe CountriesController do
resultant_countries
=
json_response
.
map
{
|
row
|
row
[
0
]}
expect
(
resultant_countries
).
not_to
include
(
World
::
DENYLIST
)
expect
(
resultant_countries
).
not_to
include
(
World
::
JH_MARKET
)
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