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
571c832d
Commit
571c832d
authored
May 03, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified assign_attributes for issuable
parent
7ad5a1b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
app/services/issuable_base_service.rb
app/services/issuable_base_service.rb
+3
-6
No files found.
app/services/issuable_base_service.rb
View file @
571c832d
...
@@ -216,15 +216,12 @@ class IssuableBaseService < BaseService
...
@@ -216,15 +216,12 @@ class IssuableBaseService < BaseService
params
[
:label_ids
]
=
label_ids
if
labels_changing?
(
issuable
.
label_ids
,
label_ids
)
params
[
:label_ids
]
=
label_ids
if
labels_changing?
(
issuable
.
label_ids
,
label_ids
)
if
issuable
.
changed?
||
params
.
present?
if
issuable
.
changed?
||
params
.
present?
issuable
.
assign_attributes
(
params
.
merge
(
updated_by:
current_user
))
if
has_title_or_description_changed?
(
issuable
)
if
has_title_or_description_changed?
(
issuable
)
issuable
.
assign_attributes
(
params
.
merge
(
issuable
.
assign_attributes
(
last_edited_at:
Time
.
now
,
last_edited_by:
current_user
)
last_edited_at:
Time
.
now
,
last_edited_by:
current_user
))
end
end
issuable
.
assign_attributes
(
params
.
merge
(
updated_by:
current_user
))
before_update
(
issuable
)
before_update
(
issuable
)
if
issuable
.
with_transaction_returning_status
{
issuable
.
save
}
if
issuable
.
with_transaction_returning_status
{
issuable
.
save
}
...
...
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