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
Kazuhiko Shiozaki
gitlab-ce
Commits
b3a90aba
Commit
b3a90aba
authored
Jun 17, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ProjectActivityCacheObserver
parent
e44e2316
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
app/models/event.rb
app/models/event.rb
+9
-0
app/observers/project_activity_cache_observer.rb
app/observers/project_activity_cache_observer.rb
+0
-8
config/application.rb
config/application.rb
+1
-2
No files found.
app/models/event.rb
View file @
b3a90aba
...
...
@@ -41,6 +41,9 @@ class Event < ActiveRecord::Base
# For Hash only
serialize
:data
# Callbacks
after_create
:reset_project_activity
# Scopes
scope
:recent
,
->
{
order
(
"created_at DESC"
)
}
scope
:code_push
,
->
{
where
(
action:
PUSHED
)
}
...
...
@@ -303,4 +306,10 @@ class Event < ActiveRecord::Base
target
.
respond_to?
:title
end
end
def
reset_project_activity
if
project
project
.
update_column
(
:last_activity_at
,
event
.
created_at
)
end
end
end
app/observers/project_activity_cache_observer.rb
deleted
100644 → 0
View file @
e44e2316
class
ProjectActivityCacheObserver
<
BaseObserver
observe
:event
def
after_create
(
event
)
event
.
project
.
update_column
(
:last_activity_at
,
event
.
created_at
)
if
event
.
project
end
end
config/application.rb
View file @
b3a90aba
...
...
@@ -19,8 +19,7 @@ module Gitlab
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
config
.
active_record
.
observers
=
:project_activity_cache_observer
,
:note_observer
,
config
.
active_record
.
observers
=
:note_observer
,
:project_observer
,
:system_hook_observer
,
:user_observer
,
...
...
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