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
847ebce9
Commit
847ebce9
authored
Aug 15, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless delegate method on List model
parent
66da64ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
7 deletions
+1
-7
list.rb
app/models/list.rb
+1
-3
list_spec.rb
spec/models/list_spec.rb
+0
-4
No files found.
app/models/list.rb
View file @
847ebce9
...
...
@@ -9,12 +9,10 @@ class List < ActiveRecord::Base
validates
:label_id
,
uniqueness:
{
scope: :board_id
},
if: :label?
validates
:position
,
numericality:
{
only_integer:
true
,
greater_than_or_equal_to:
0
},
if: :label?
delegate
:name
,
to: :label
,
allow_nil:
true
,
prefix:
true
before_destroy
:can_be_destroyed
,
unless: :label?
def
title
label?
?
label
_
name
:
list_type
.
humanize
label?
?
label
.
name
:
list_type
.
humanize
end
private
...
...
spec/models/list_spec.rb
View file @
847ebce9
...
...
@@ -6,10 +6,6 @@ describe List do
it
{
is_expected
.
to
belong_to
(
:label
)
}
end
describe
'delegate methods'
do
it
{
is_expected
.
to
delegate_method
(
:name
).
to
(
:label
).
with_prefix
}
end
describe
'validations'
do
it
{
is_expected
.
to
validate_presence_of
(
:board
)
}
it
{
is_expected
.
to
validate_presence_of
(
:label
)
}
...
...
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