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
b6628b4a
Commit
b6628b4a
authored
Oct 25, 2012
by
Valeriy Sizov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1797 from sholden/patch-2
Fix broken Note scopes with lambdas, 4.0 compat
parents
5add5f76
2335d7b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
app/models/note.rb
app/models/note.rb
+6
-6
No files found.
app/models/note.rb
View file @
b6628b4a
...
...
@@ -23,13 +23,13 @@ class Note < ActiveRecord::Base
mount_uploader
:attachment
,
AttachmentUploader
# Scopes
scope
:common
,
where
(
noteable_id:
nil
)
scope
:today
,
where
(
"created_at >= :date"
,
date:
Date
.
today
)
scope
:last_week
,
where
(
"created_at >= :date"
,
date:
(
Date
.
today
-
7
.
days
))
scope
:common
,
->
{
where
(
noteable_id:
nil
)
}
scope
:today
,
->
{
where
(
"created_at >= :date"
,
date:
Date
.
today
)
}
scope
:last_week
,
->
{
where
(
"created_at >= :date"
,
date:
(
Date
.
today
-
7
.
days
))
}
scope
:since
,
->
(
day
)
{
where
(
"created_at >= :date"
,
date:
(
day
))
}
scope
:fresh
,
order
(
"created_at ASC, id ASC"
)
scope
:inc_author_project
,
includes
(
:project
,
:author
)
scope
:inc_author
,
includes
(
:author
)
scope
:fresh
,
->
{
order
(
"created_at ASC, id ASC"
)
}
scope
:inc_author_project
,
->
{
includes
(
:project
,
:author
)
}
scope
:inc_author
,
->
{
includes
(
:author
)
}
def
self
.
create_status_change_note
(
noteable
,
author
,
status
)
create
({
...
...
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