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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
7047a44a
Commit
7047a44a
authored
Aug 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sett iid on create. Use iid as value to_param
parent
125c07fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+12
-0
app/models/merge_request.rb
app/models/merge_request.rb
+4
-0
No files found.
app/models/concerns/issuable.rb
View file @
7047a44a
...
...
@@ -16,6 +16,7 @@ module Issuable
validates
:author
,
presence:
true
validates
:title
,
presence:
true
,
length:
{
within:
0
..
255
}
validates
:iid
,
presence:
true
,
numericality:
true
scope
:authored
,
->
(
user
)
{
where
(
author_id:
user
)
}
scope
:assigned_to
,
->
(
u
)
{
where
(
assignee_id:
u
.
id
)}
...
...
@@ -24,6 +25,8 @@ 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
,
to: :author
,
...
...
@@ -44,6 +47,15 @@ module Issuable
end
end
def
set_iid
max_iid
=
project
.
send
(
self
.
class
.
name
.
tableize
).
maximum
(
:iid
)
self
.
iid
=
max_iid
.
to_i
+
1
end
def
to_param
iid
.
to_s
end
def
today?
Date
.
today
==
created_at
.
to_date
end
...
...
app/models/merge_request.rb
View file @
7047a44a
...
...
@@ -250,6 +250,10 @@ class MergeRequest < ActiveRecord::Base
(
source_project
.
root_ref?
source_branch
)
||
for_fork?
end
def
project
target_project
end
private
def
dump_commits
(
commits
)
...
...
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