BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
37fbb15a
Commit
37fbb15a
authored
Sep 07, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored some stuff and added new models / attributes after rebase
parent
0f15e971
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
11 deletions
+17
-11
all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+2
-1
model_configuration_spec.rb
spec/lib/gitlab/import_export/model_configuration_spec.rb
+2
-2
safe_model_attributes.yml
spec/lib/gitlab/import_export/safe_model_attributes.yml
+11
-0
configuration_helper.rb
spec/support/import_export/configuration_helper.rb
+2
-4
export_file_helper.rb
spec/support/import_export/export_file_helper.rb
+0
-4
No files found.
spec/lib/gitlab/import_export/all_models.yml
View file @
37fbb15a
...
...
@@ -11,7 +11,6 @@ issues:
-
labels
-
todos
-
user_agent_detail
-
project
-
moved_to
-
events
events
:
...
...
@@ -173,3 +172,4 @@ project:
-
triggers
-
environments
-
deployments
-
project_feature
\ No newline at end of file
spec/lib/gitlab/import_export/model_configuration_spec.rb
View file @
37fbb15a
...
...
@@ -23,7 +23,7 @@ describe 'Import/Export model configuration', lib: true do
it
'has no new models'
do
model_names
.
each
do
|
model_name
|
new_models
=
current_models
[
model_name
]
-
all_models
[
model_name
]
new_models
=
Array
(
current_models
[
model_name
])
-
Array
(
all_models
[
model_name
])
expect
(
new_models
).
to
be_empty
,
failure_message
(
model_name
.
classify
,
new_models
)
end
end
...
...
@@ -36,7 +36,7 @@ describe 'Import/Export model configuration', lib: true do
model_names
.
each
do
|
model_name
|
model_class
=
relation_class_for_name
(
model_name
)
all_models_hash
[
model_name
]
=
associations_for
(
model_class
)
all_models_hash
[
model_name
]
=
associations_for
(
model_class
)
-
[
'project'
]
end
all_models_hash
...
...
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
37fbb15a
...
...
@@ -298,3 +298,13 @@ Project:
-
archived
Author
:
-
name
ProjectFeature
:
-
id
-
project_id
-
merge_requests_access_level
-
issues_access_level
-
wiki_access_level
-
snippets_access_level
-
builds_access_level
-
created_at
-
updated_at
\ No newline at end of file
spec/support/import_export/configuration_helper.rb
View file @
37fbb15a
...
...
@@ -23,9 +23,7 @@ module ConfigurationHelper
attributes
end
def
associations_for
(
model_class
)
model_class
.
reflect_on_all_associations
.
map
do
|
association
|
association
.
name
.
to_s
end
def
associations_for
(
safe_model
)
safe_model
.
reflect_on_all_associations
.
map
{
|
assoc
|
assoc
.
name
.
to_s
}
end
end
spec/support/import_export/export_file_helper.rb
View file @
37fbb15a
...
...
@@ -120,10 +120,6 @@ module ExportFileHelper
false
end
def
associations_for
(
safe_model
)
safe_model
.
reflect_on_all_associations
.
map
{
|
assoc
|
assoc
.
name
.
to_s
}
end
# Compares model attributes with those those found in the hash
# and returns true if there is a match, ignoring some excluded attributes.
def
safe_model?
(
model
,
excluded_attributes
,
parent
)
...
...
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