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
2a8858ca
Commit
2a8858ca
authored
Mar 18, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `Todo#to_reference` to `Todo#target_reference`
Since we're not actually returning a todo reference.
parent
05975e96
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+1
-1
app/models/todo.rb
app/models/todo.rb
+1
-1
spec/models/todo_spec.rb
spec/models/todo_spec.rb
+3
-3
No files found.
app/helpers/todos_helper.rb
View file @
2a8858ca
...
...
@@ -16,7 +16,7 @@ module TodosHelper
def
todo_target_link
(
todo
)
target
=
todo
.
target_type
.
titleize
.
downcase
link_to
"
#{
target
}
#{
todo
.
t
o_reference
}
"
,
todo_target_path
(
todo
),
{
title:
h
(
todo
.
target
.
title
)
}
link_to
"
#{
target
}
#{
todo
.
t
arget_reference
}
"
,
todo_target_path
(
todo
),
{
title:
todo
.
target
.
title
}
end
def
todo_target_path
(
todo
)
...
...
app/models/todo.rb
View file @
2a8858ca
...
...
@@ -71,7 +71,7 @@ class Todo < ActiveRecord::Base
nil
end
def
t
o
_reference
def
t
arget
_reference
if
for_commit?
target
.
short_id
else
...
...
spec/models/todo_spec.rb
View file @
2a8858ca
...
...
@@ -115,18 +115,18 @@ describe Todo, models: true do
end
end
describe
'#t
o
_reference'
do
describe
'#t
arget
_reference'
do
it
'returns the short commit id for commits'
do
subject
.
project
=
project
subject
.
target_type
=
'Commit'
subject
.
commit_id
=
commit
.
id
expect
(
subject
.
t
o
_reference
).
to
eq
commit
.
short_id
expect
(
subject
.
t
arget
_reference
).
to
eq
commit
.
short_id
end
it
'returns reference for issuables'
do
subject
.
target
=
issue
expect
(
subject
.
t
o
_reference
).
to
eq
issue
.
to_reference
expect
(
subject
.
t
arget
_reference
).
to
eq
issue
.
to_reference
end
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