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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
682d213f
Commit
682d213f
authored
Jan 27, 2017
by
Douglas Barbosa Alexandre
Committed by
Fatih Acet
Feb 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove backlog lists from boards
parent
3aabf0c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
55 deletions
+50
-55
app/models/board.rb
app/models/board.rb
+0
-4
app/models/list.rb
app/models/list.rb
+1
-1
db/migrate/20170127032550_remove_backlog_lists_from_boards.rb
...igrate/20170127032550_remove_backlog_lists_from_boards.rb
+19
-0
db/schema.rb
db/schema.rb
+26
-15
spec/models/list_spec.rb
spec/models/list_spec.rb
+4
-35
No files found.
app/models/board.rb
View file @
682d213f
...
@@ -5,10 +5,6 @@ class Board < ActiveRecord::Base
...
@@ -5,10 +5,6 @@ class Board < ActiveRecord::Base
validates
:project
,
presence:
true
validates
:project
,
presence:
true
def
backlog_list
lists
.
merge
(
List
.
backlog
).
take
end
def
done_list
def
done_list
lists
.
merge
(
List
.
done
).
take
lists
.
merge
(
List
.
done
).
take
end
end
...
...
app/models/list.rb
View file @
682d213f
...
@@ -2,7 +2,7 @@ class List < ActiveRecord::Base
...
@@ -2,7 +2,7 @@ class List < ActiveRecord::Base
belongs_to
:board
belongs_to
:board
belongs_to
:label
belongs_to
:label
enum
list_type:
{
backlog:
0
,
label:
1
,
done:
2
}
enum
list_type:
{
label:
1
,
done:
2
}
validates
:board
,
:list_type
,
presence:
true
validates
:board
,
:list_type
,
presence:
true
validates
:label
,
:position
,
presence:
true
,
if: :label?
validates
:label
,
:position
,
presence:
true
,
if: :label?
...
...
db/migrate/20170127032550_remove_backlog_lists_from_boards.rb
0 → 100644
View file @
682d213f
class
RemoveBacklogListsFromBoards
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
up
execute
<<-
SQL
DELETE FROM lists WHERE list_type = 0;
SQL
end
def
down
execute
<<-
SQL
INSERT INTO lists (board_id, list_type, created_at, updated_at)
SELECT boards.id, 0, NOW(), NOW()
FROM boards;
SQL
end
end
db/schema.rb
View file @
682d213f
...
@@ -87,9 +87,9 @@ ActiveRecord::Schema.define(version: 20170130204620) do
...
@@ -87,9 +87,9 @@ ActiveRecord::Schema.define(version: 20170130204620) do
t
.
boolean
"send_user_confirmation_email"
,
default:
false
t
.
boolean
"send_user_confirmation_email"
,
default:
false
t
.
integer
"container_registry_token_expire_delay"
,
default:
5
t
.
integer
"container_registry_token_expire_delay"
,
default:
5
t
.
text
"after_sign_up_text"
t
.
text
"after_sign_up_text"
t
.
boolean
"user_default_external"
,
default:
false
,
null:
false
t
.
string
"repository_storages"
,
default:
"default"
t
.
string
"repository_storages"
,
default:
"default"
t
.
string
"enabled_git_access_protocol"
t
.
string
"enabled_git_access_protocol"
t
.
boolean
"user_default_external"
,
default:
false
,
null:
false
t
.
boolean
"domain_blacklist_enabled"
,
default:
false
t
.
boolean
"domain_blacklist_enabled"
,
default:
false
t
.
text
"domain_blacklist"
t
.
text
"domain_blacklist"
t
.
boolean
"koding_enabled"
t
.
boolean
"koding_enabled"
...
@@ -98,14 +98,14 @@ ActiveRecord::Schema.define(version: 20170130204620) do
...
@@ -98,14 +98,14 @@ ActiveRecord::Schema.define(version: 20170130204620) do
t
.
text
"help_page_text_html"
t
.
text
"help_page_text_html"
t
.
text
"shared_runners_text_html"
t
.
text
"shared_runners_text_html"
t
.
text
"after_sign_up_text_html"
t
.
text
"after_sign_up_text_html"
t
.
boolean
"sidekiq_throttling_enabled"
,
default:
false
t
.
string
"sidekiq_throttling_queues"
t
.
decimal
"sidekiq_throttling_factor"
t
.
boolean
"housekeeping_enabled"
,
default:
true
,
null:
false
t
.
boolean
"housekeeping_enabled"
,
default:
true
,
null:
false
t
.
boolean
"housekeeping_bitmaps_enabled"
,
default:
true
,
null:
false
t
.
boolean
"housekeeping_bitmaps_enabled"
,
default:
true
,
null:
false
t
.
integer
"housekeeping_incremental_repack_period"
,
default:
10
,
null:
false
t
.
integer
"housekeeping_incremental_repack_period"
,
default:
10
,
null:
false
t
.
integer
"housekeeping_full_repack_period"
,
default:
50
,
null:
false
t
.
integer
"housekeeping_full_repack_period"
,
default:
50
,
null:
false
t
.
integer
"housekeeping_gc_period"
,
default:
200
,
null:
false
t
.
integer
"housekeeping_gc_period"
,
default:
200
,
null:
false
t
.
boolean
"sidekiq_throttling_enabled"
,
default:
false
t
.
string
"sidekiq_throttling_queues"
t
.
decimal
"sidekiq_throttling_factor"
t
.
boolean
"html_emails_enabled"
,
default:
true
t
.
boolean
"html_emails_enabled"
,
default:
true
t
.
string
"plantuml_url"
t
.
string
"plantuml_url"
t
.
boolean
"plantuml_enabled"
t
.
boolean
"plantuml_enabled"
...
@@ -398,22 +398,22 @@ ActiveRecord::Schema.define(version: 20170130204620) do
...
@@ -398,22 +398,22 @@ ActiveRecord::Schema.define(version: 20170130204620) do
add_index
"deploy_keys_projects"
,
[
"project_id"
],
name:
"index_deploy_keys_projects_on_project_id"
,
using: :btree
add_index
"deploy_keys_projects"
,
[
"project_id"
],
name:
"index_deploy_keys_projects_on_project_id"
,
using: :btree
create_table
"deployments"
,
force: :cascade
do
|
t
|
create_table
"deployments"
,
force: :cascade
do
|
t
|
t
.
integer
"iid"
,
null:
false
t
.
integer
"iid"
t
.
integer
"project_id"
,
null:
false
t
.
integer
"project_id"
t
.
integer
"environment_id"
,
null:
false
t
.
integer
"environment_id"
t
.
string
"ref"
,
null:
false
t
.
string
"ref"
t
.
boolean
"tag"
,
null:
false
t
.
boolean
"tag"
t
.
string
"sha"
,
null:
false
t
.
string
"sha"
t
.
integer
"user_id"
t
.
integer
"user_id"
t
.
integer
"deployable_id"
t
.
integer
"deployable_id"
,
null:
false
t
.
string
"deployable_type"
t
.
string
"deployable_type"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"updated_at"
t
.
string
"on_stop"
t
.
string
"on_stop"
end
end
add_index
"deployments"
,
[
"project_id"
,
"environment_id"
,
"iid"
],
name:
"index_deployments_on_project_id_and_environment_id_and_iid"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"environment_id"
,
"iid"
],
name:
"index_deployments_on_project_id_and_environment_id_and_iid"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"iid"
],
name:
"index_deployments_on_project_id_and_iid"
,
u
nique:
true
,
u
sing: :btree
add_index
"deployments"
,
[
"project_id"
,
"iid"
],
name:
"index_deployments_on_project_id_and_iid"
,
using: :btree
create_table
"emails"
,
force: :cascade
do
|
t
|
create_table
"emails"
,
force: :cascade
do
|
t
|
t
.
integer
"user_id"
,
null:
false
t
.
integer
"user_id"
,
null:
false
...
@@ -685,8 +685,8 @@ ActiveRecord::Schema.define(version: 20170130204620) do
...
@@ -685,8 +685,8 @@ ActiveRecord::Schema.define(version: 20170130204620) do
t
.
integer
"merge_user_id"
t
.
integer
"merge_user_id"
t
.
string
"merge_commit_sha"
t
.
string
"merge_commit_sha"
t
.
datetime
"deleted_at"
t
.
datetime
"deleted_at"
t
.
string
"in_progress_merge_commit_sha"
t
.
integer
"lock_version"
t
.
integer
"lock_version"
t
.
string
"in_progress_merge_commit_sha"
t
.
text
"title_html"
t
.
text
"title_html"
t
.
text
"description_html"
t
.
text
"description_html"
t
.
integer
"time_estimate"
t
.
integer
"time_estimate"
...
@@ -763,6 +763,16 @@ ActiveRecord::Schema.define(version: 20170130204620) do
...
@@ -763,6 +763,16 @@ ActiveRecord::Schema.define(version: 20170130204620) do
add_index
"namespaces"
,
[
"path"
],
name:
"index_namespaces_on_path_trigram"
,
using: :gin
,
opclasses:
{
"path"
=>
"gin_trgm_ops"
}
add_index
"namespaces"
,
[
"path"
],
name:
"index_namespaces_on_path_trigram"
,
using: :gin
,
opclasses:
{
"path"
=>
"gin_trgm_ops"
}
add_index
"namespaces"
,
[
"type"
],
name:
"index_namespaces_on_type"
,
using: :btree
add_index
"namespaces"
,
[
"type"
],
name:
"index_namespaces_on_type"
,
using: :btree
create_table
"note_templates"
,
force: :cascade
do
|
t
|
t
.
integer
"user_id"
t
.
string
"title"
t
.
text
"note"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"note_templates"
,
[
"user_id"
],
name:
"index_note_templates_on_user_id"
,
using: :btree
create_table
"notes"
,
force: :cascade
do
|
t
|
create_table
"notes"
,
force: :cascade
do
|
t
|
t
.
text
"note"
t
.
text
"note"
t
.
string
"noteable_type"
t
.
string
"noteable_type"
...
@@ -778,6 +788,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do
...
@@ -778,6 +788,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do
t
.
text
"st_diff"
t
.
text
"st_diff"
t
.
integer
"updated_by_id"
t
.
integer
"updated_by_id"
t
.
string
"type"
t
.
string
"type"
t
.
string
"system_type"
t
.
text
"position"
t
.
text
"position"
t
.
text
"original_position"
t
.
text
"original_position"
t
.
datetime
"resolved_at"
t
.
datetime
"resolved_at"
...
@@ -960,7 +971,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do
...
@@ -960,7 +971,7 @@ ActiveRecord::Schema.define(version: 20170130204620) do
t
.
boolean
"has_external_wiki"
t
.
boolean
"has_external_wiki"
t
.
boolean
"lfs_enabled"
t
.
boolean
"lfs_enabled"
t
.
text
"description_html"
t
.
text
"description_html"
t
.
boolean
"only_allow_merge_if_all_discussions_are_resolved"
t
.
boolean
"only_allow_merge_if_all_discussions_are_resolved"
,
default:
false
,
null:
false
end
end
add_index
"projects"
,
[
"ci_id"
],
name:
"index_projects_on_ci_id"
,
using: :btree
add_index
"projects"
,
[
"ci_id"
],
name:
"index_projects_on_ci_id"
,
using: :btree
...
...
spec/models/list_spec.rb
View file @
682d213f
...
@@ -19,13 +19,6 @@ describe List do
...
@@ -19,13 +19,6 @@ describe List do
expect
(
subject
).
to
validate_uniqueness_of
(
:label_id
).
scoped_to
(
:board_id
)
expect
(
subject
).
to
validate_uniqueness_of
(
:label_id
).
scoped_to
(
:board_id
)
end
end
context
'when list_type is set to backlog'
do
subject
{
described_class
.
new
(
list_type: :backlog
)
}
it
{
is_expected
.
not_to
validate_presence_of
(
:label
)
}
it
{
is_expected
.
not_to
validate_presence_of
(
:position
)
}
end
context
'when list_type is set to done'
do
context
'when list_type is set to done'
do
subject
{
described_class
.
new
(
list_type: :done
)
}
subject
{
described_class
.
new
(
list_type: :done
)
}
...
@@ -41,12 +34,6 @@ describe List do
...
@@ -41,12 +34,6 @@ describe List do
expect
(
subject
.
destroy
).
to
be_truthy
expect
(
subject
.
destroy
).
to
be_truthy
end
end
it
'can not be destroyed when list_type is set to backlog'
do
subject
=
create
(
:backlog_list
)
expect
(
subject
.
destroy
).
to
be_falsey
end
it
'can not be destroyed when when list_type is set to done'
do
it
'can not be destroyed when when list_type is set to done'
do
subject
=
create
(
:done_list
)
subject
=
create
(
:done_list
)
...
@@ -55,19 +42,13 @@ describe List do
...
@@ -55,19 +42,13 @@ describe List do
end
end
describe
'#destroyable?'
do
describe
'#destroyable?'
do
it
'ret
ru
ns true when list_type is set to label'
do
it
'ret
ur
ns true when list_type is set to label'
do
subject
.
list_type
=
:label
subject
.
list_type
=
:label
expect
(
subject
).
to
be_destroyable
expect
(
subject
).
to
be_destroyable
end
end
it
'retruns false when list_type is set to backlog'
do
it
'returns false when list_type is set to done'
do
subject
.
list_type
=
:backlog
expect
(
subject
).
not_to
be_destroyable
end
it
'retruns false when list_type is set to done'
do
subject
.
list_type
=
:done
subject
.
list_type
=
:done
expect
(
subject
).
not_to
be_destroyable
expect
(
subject
).
not_to
be_destroyable
...
@@ -75,19 +56,13 @@ describe List do
...
@@ -75,19 +56,13 @@ describe List do
end
end
describe
'#movable?'
do
describe
'#movable?'
do
it
'ret
ru
ns true when list_type is set to label'
do
it
'ret
ur
ns true when list_type is set to label'
do
subject
.
list_type
=
:label
subject
.
list_type
=
:label
expect
(
subject
).
to
be_movable
expect
(
subject
).
to
be_movable
end
end
it
'retruns false when list_type is set to backlog'
do
it
'returns false when list_type is set to done'
do
subject
.
list_type
=
:backlog
expect
(
subject
).
not_to
be_movable
end
it
'retruns false when list_type is set to done'
do
subject
.
list_type
=
:done
subject
.
list_type
=
:done
expect
(
subject
).
not_to
be_movable
expect
(
subject
).
not_to
be_movable
...
@@ -102,12 +77,6 @@ describe List do
...
@@ -102,12 +77,6 @@ describe List do
expect
(
subject
.
title
).
to
eq
'Development'
expect
(
subject
.
title
).
to
eq
'Development'
end
end
it
'returns Backlog when list_type is set to backlog'
do
subject
.
list_type
=
:backlog
expect
(
subject
.
title
).
to
eq
'Backlog'
end
it
'returns Done when list_type is set to done'
do
it
'returns Done when list_type is set to done'
do
subject
.
list_type
=
:done
subject
.
list_type
=
:done
...
...
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