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
1df2be43
Commit
1df2be43
authored
Oct 05, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add name to board model
parent
95b511d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
1 deletion
+19
-1
app/models/board.rb
app/models/board.rb
+1
-1
db/migrate/20161005144359_add_name_to_boards.rb
db/migrate/20161005144359_add_name_to_boards.rb
+15
-0
db/schema.rb
db/schema.rb
+1
-0
spec/factories/boards.rb
spec/factories/boards.rb
+1
-0
spec/models/board_spec.rb
spec/models/board_spec.rb
+1
-0
No files found.
app/models/board.rb
View file @
1df2be43
...
...
@@ -3,7 +3,7 @@ class Board < ActiveRecord::Base
has_many
:lists
,
->
{
order
(
:list_type
,
:position
)
},
dependent: :delete_all
validates
:project
,
presence:
true
validates
:
name
,
:
project
,
presence:
true
def
backlog_list
lists
.
merge
(
List
.
backlog
).
take
...
...
db/migrate/20161005144359_add_name_to_boards.rb
0 → 100644
View file @
1df2be43
class
AddNameToBoards
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column_with_default
:boards
,
:name
,
:string
,
default:
'Development'
end
def
down
remove_column
:boards
,
:name
end
end
db/schema.rb
View file @
1df2be43
...
...
@@ -167,6 +167,7 @@ ActiveRecord::Schema.define(version: 20161007133303) do
t
.
integer
"project_id"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"name"
,
default:
"Development"
,
null:
false
end
add_index
"boards"
,
[
"project_id"
],
name:
"index_boards_on_project_id"
,
using: :btree
...
...
spec/factories/boards.rb
View file @
1df2be43
FactoryGirl
.
define
do
factory
:board
do
sequence
(
:name
)
{
|
n
|
"board
#{
n
}
"
}
project
factory: :empty_project
after
(
:create
)
do
|
board
|
...
...
spec/models/board_spec.rb
View file @
1df2be43
...
...
@@ -7,6 +7,7 @@ describe Board do
end
describe
'validations'
do
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_presence_of
(
:project
)
}
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