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
Boxiang Sun
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
7 deletions
+1
-7
app/models/list.rb
app/models/list.rb
+1
-3
spec/models/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