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
Léo-Paul Géneau
gitlab-ce
Commits
48d3e5fa
Commit
48d3e5fa
authored
Aug 24, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace `is_edited?` with `edited?`
parent
edd56aea
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
8 deletions
+10
-8
.rubocop_todo.yml
.rubocop_todo.yml
+3
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-1
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+1
-1
app/models/concerns/editable.rb
app/models/concerns/editable.rb
+1
-1
spec/models/concerns/editable_spec.rb
spec/models/concerns/editable_spec.rb
+3
-3
No files found.
.rubocop_todo.yml
View file @
48d3e5fa
...
@@ -243,7 +243,9 @@ Style/PerlBackrefs:
...
@@ -243,7 +243,9 @@ Style/PerlBackrefs:
# NamePrefixBlacklist: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
# NameWhitelist: is_a?
Style/PredicateName
:
Style/PredicateName
:
Enabled
:
false
Enabled
:
true
# NamePrefix: is_
NamePrefixBlacklist
:
is_
# Offense count: 58
# Offense count: 58
# Cop supports --auto-correct.
# Cop supports --auto-correct.
...
...
app/controllers/projects/issues_controller.rb
View file @
48d3e5fa
...
@@ -202,7 +202,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -202,7 +202,7 @@ class Projects::IssuesController < Projects::ApplicationController
task_status:
@issue
.
task_status
task_status:
@issue
.
task_status
}
}
if
@issue
.
is_
edited?
if
@issue
.
edited?
response
[
:updated_at
]
=
@issue
.
updated_at
response
[
:updated_at
]
=
@issue
.
updated_at
response
[
:updated_by_name
]
=
@issue
.
last_edited_by
.
name
response
[
:updated_by_name
]
=
@issue
.
last_edited_by
.
name
response
[
:updated_by_path
]
=
user_path
(
@issue
.
last_edited_by
)
response
[
:updated_by_path
]
=
user_path
(
@issue
.
last_edited_by
)
...
...
app/helpers/application_helper.rb
View file @
48d3e5fa
...
@@ -178,7 +178,7 @@ module ApplicationHelper
...
@@ -178,7 +178,7 @@ module ApplicationHelper
end
end
def
edited_time_ago_with_tooltip
(
object
,
placement:
'top'
,
html_class:
'time_ago'
,
exclude_author:
false
)
def
edited_time_ago_with_tooltip
(
object
,
placement:
'top'
,
html_class:
'time_ago'
,
exclude_author:
false
)
return
unless
object
.
is_
edited?
return
unless
object
.
edited?
content_tag
:small
,
class:
'edited-text'
do
content_tag
:small
,
class:
'edited-text'
do
output
=
content_tag
(
:span
,
'Edited '
)
output
=
content_tag
(
:span
,
'Edited '
)
...
...
app/helpers/issuables_helper.rb
View file @
48d3e5fa
...
@@ -229,7 +229,7 @@ module IssuablesHelper
...
@@ -229,7 +229,7 @@ module IssuablesHelper
end
end
def
updated_at_by
(
issuable
)
def
updated_at_by
(
issuable
)
return
{}
unless
issuable
.
is_
edited?
return
{}
unless
issuable
.
edited?
{
{
updatedAt:
issuable
.
updated_at
.
to_time
.
iso8601
,
updatedAt:
issuable
.
updated_at
.
to_time
.
iso8601
,
...
...
app/models/concerns/editable.rb
View file @
48d3e5fa
module
Editable
module
Editable
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
def
is_
edited?
def
edited?
last_edited_at
.
present?
&&
last_edited_at
!=
created_at
last_edited_at
.
present?
&&
last_edited_at
!=
created_at
end
end
...
...
spec/models/concerns/editable_spec.rb
View file @
48d3e5fa
require
'spec_helper'
require
'spec_helper'
describe
Editable
do
describe
Editable
do
describe
'#
is_
edited?'
do
describe
'#edited?'
do
let
(
:issue
)
{
create
(
:issue
,
last_edited_at:
nil
)
}
let
(
:issue
)
{
create
(
:issue
,
last_edited_at:
nil
)
}
let
(
:edited_issue
)
{
create
(
:issue
,
created_at:
3
.
days
.
ago
,
last_edited_at:
2
.
days
.
ago
)
}
let
(
:edited_issue
)
{
create
(
:issue
,
created_at:
3
.
days
.
ago
,
last_edited_at:
2
.
days
.
ago
)
}
it
{
expect
(
issue
.
is_
edited?
).
to
eq
(
false
)
}
it
{
expect
(
issue
.
edited?
).
to
eq
(
false
)
}
it
{
expect
(
edited_issue
.
is_
edited?
).
to
eq
(
true
)
}
it
{
expect
(
edited_issue
.
edited?
).
to
eq
(
true
)
}
end
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