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
28592691
Commit
28592691
authored
Apr 28, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Serialize last_fetched_at as a string with seconds
parent
7ec5ff4d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
app/controllers/projects/notes_controller.rb
app/controllers/projects/notes_controller.rb
+1
-1
app/finders/notes_finder.rb
app/finders/notes_finder.rb
+1
-1
app/views/projects/notes/_notes_with_form.html.haml
app/views/projects/notes/_notes_with_form.html.haml
+1
-1
spec/finders/notes_finder_spec.rb
spec/finders/notes_finder_spec.rb
+1
-1
No files found.
app/controllers/projects/notes_controller.rb
View file @
28592691
...
@@ -5,7 +5,7 @@ class Projects::NotesController < Projects::ApplicationController
...
@@ -5,7 +5,7 @@ class Projects::NotesController < Projects::ApplicationController
before_filter
:authorize_admin_note!
,
only:
[
:update
,
:destroy
]
before_filter
:authorize_admin_note!
,
only:
[
:update
,
:destroy
]
def
index
def
index
current_fetched_at
=
Time
.
now
current_fetched_at
=
Time
.
now
.
to_i
@notes
=
NotesFinder
.
new
.
execute
(
project
,
current_user
,
params
)
@notes
=
NotesFinder
.
new
.
execute
(
project
,
current_user
,
params
)
notes_json
=
{
notes:
[],
last_fetched_at:
current_fetched_at
}
notes_json
=
{
notes:
[],
last_fetched_at:
current_fetched_at
}
...
...
app/finders/notes_finder.rb
View file @
28592691
...
@@ -4,7 +4,7 @@ class NotesFinder
...
@@ -4,7 +4,7 @@ class NotesFinder
def
execute
(
project
,
current_user
,
params
)
def
execute
(
project
,
current_user
,
params
)
target_type
=
params
[
:target_type
]
target_type
=
params
[
:target_type
]
target_id
=
params
[
:target_id
]
target_id
=
params
[
:target_id
]
last_fetched_at
=
params
.
fetch
(
:last_fetched_at
)
last_fetched_at
=
Time
.
at
(
params
.
fetch
(
:last_fetched_at
).
to_i
)
notes
=
case
target_type
notes
=
case
target_type
when
"commit"
when
"commit"
...
...
app/views/projects/notes/_notes_with_form.html.haml
View file @
28592691
...
@@ -7,4 +7,4 @@
...
@@ -7,4 +7,4 @@
=
render
"projects/notes/form"
=
render
"projects/notes/form"
:javascript
:javascript
new
Notes
(
"
#{
project_notes_path
(
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
)
}
"
,
#{
@notes
.
map
(
&
:id
).
to_json
}
,
Time
.
now
)
new
Notes
(
"
#{
project_notes_path
(
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
)
}
"
,
#{
@notes
.
map
(
&
:id
).
to_json
}
,
#{
Time
.
now
.
to_i
}
)
spec/finders/notes_finder_spec.rb
View file @
28592691
...
@@ -12,7 +12,7 @@ describe NotesFinder do
...
@@ -12,7 +12,7 @@ describe NotesFinder do
end
end
describe
:execute
do
describe
:execute
do
let
(
:params
)
{
{
target_id:
commit
.
id
,
target_type:
'commit'
,
last_fetched_at:
1
.
hour
.
ago
}
}
let
(
:params
)
{
{
target_id:
commit
.
id
,
target_type:
'commit'
,
last_fetched_at:
1
.
hour
.
ago
.
to_i
}
}
before
do
before
do
note1
note1
...
...
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