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
434c0341
Commit
434c0341
authored
Aug 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Iid improvemets
* call set_iid before validation * make rake task pass event if objects are invalid * show iid in comment event at dashboard
parent
20397091
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
6 deletions
+16
-6
events_helper.rb
app/helpers/events_helper.rb
+1
-1
issuable.rb
app/models/concerns/issuable.rb
+1
-1
event.rb
app/models/event.rb
+8
-0
_result.html.haml
app/views/search/_result.html.haml
+2
-2
migrate_iids.rake
lib/tasks/migrate/migrate_iids.rake
+4
-2
No files found.
app/helpers/events_helper.rb
View file @
434c0341
...
...
@@ -109,7 +109,7 @@ module EventsHelper
else
link_to
event_note_target_path
(
event
)
do
content_tag
:strong
do
"
#{
event
.
note_target_type
}
#
#{
truncate
event
.
note_target_id
}
"
"
#{
event
.
note_target_type
}
#
#{
truncate
event
.
note_target_i
i
d
}
"
end
end
end
...
...
app/models/concerns/issuable.rb
View file @
434c0341
...
...
@@ -16,6 +16,7 @@ module Issuable
validates
:author
,
presence:
true
validates
:title
,
presence:
true
,
length:
{
within:
0
..
255
}
validate
:set_iid
,
on: :create
validates
:iid
,
presence:
true
,
numericality:
true
scope
:authored
,
->
(
user
)
{
where
(
author_id:
user
)
}
...
...
@@ -25,7 +26,6 @@ module Issuable
scope
:unassigned
,
->
{
where
(
"assignee_id IS NULL"
)
}
scope
:of_projects
,
->
(
ids
)
{
where
(
project_id:
ids
)
}
validate
:set_iid
,
on: :create
delegate
:name
,
:email
,
...
...
app/models/event.rb
View file @
434c0341
...
...
@@ -284,6 +284,14 @@ class Event < ActiveRecord::Base
end
end
def
note_target_iid
if
note_target
.
respond_to?
(
:iid
)
note_target
.
iid
else
note_target_id
end
.
to_s
end
def
wall_note?
target
.
noteable_type
.
blank?
end
...
...
app/views/search/_result.html.haml
View file @
434c0341
...
...
@@ -23,7 +23,7 @@
%li
merge request:
=
link_to
[
merge_request
.
target_project
,
merge_request
]
do
%span
##{merge_request.id}
%span
##{merge_request.i
i
d}
%strong
.term
=
truncate
merge_request
.
title
,
length:
50
-
if
merge_request
.
for_fork?
...
...
@@ -37,7 +37,7 @@
%li
issue:
=
link_to
[
issue
.
project
,
issue
]
do
%span
##{issue.id}
%span
##{issue.i
i
d}
%strong
.term
=
truncate
issue
.
title
,
length:
50
%span
.light
(
#{
issue
.
project
.
name_with_namespace
}
)
...
...
lib/tasks/migrate/migrate_iids.rake
View file @
434c0341
...
...
@@ -4,7 +4,7 @@ task migrate_iids: :environment do
Issue
.
where
(
iid:
nil
).
find_each
(
batch_size:
100
)
do
|
issue
|
begin
issue
.
set_iid
if
issue
.
save
if
issue
.
update_attribute
(
:iid
,
mr
.
iid
)
print
'.'
else
print
'F'
...
...
@@ -19,7 +19,7 @@ task migrate_iids: :environment do
MergeRequest
.
where
(
iid:
nil
).
find_each
(
batch_size:
100
)
do
|
mr
|
begin
mr
.
set_iid
if
mr
.
save
if
mr
.
update_attribute
(
:iid
,
mr
.
iid
)
print
'.'
else
print
'F'
...
...
@@ -28,4 +28,6 @@ task migrate_iids: :environment do
print
'F'
end
end
puts
'done'
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