#200: removed activity_feed_observer

This commit is contained in:
Vokhmin Alexey V 2013-06-27 18:40:19 +04:00
parent 8782129985
commit 66fe5c11cf
4 changed files with 8 additions and 6 deletions

View File

@ -65,7 +65,7 @@ class GitHook
end
def self.process(*args)
ActivityFeedObserver.instance.after_create(args.size > 1 ? GitHook.new(*args) : args.first)
Modules::Observers::ActivityFeed::Git.create_notifications(args.size > 1 ? GitHook.new(*args) : args.first)
end
def find_user(user)

View File

@ -34,7 +34,7 @@ module Rosa
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
config.active_record.observers = :event_log_observer, :activity_feed_observer, :build_list_observer
config.active_record.observers = :event_log_observer, :build_list_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.

View File

@ -150,7 +150,7 @@ module Modules
module ClassMethods
def process_hook(owner_uname, repo, newrev, oldrev, ref, newrev_type, user = nil, message = nil)
rec = GitHook.new(owner_uname, repo, newrev, oldrev, ref, newrev_type, user, message)
ActivityFeedObserver.instance.after_create rec
Modules::Observers::ActivityFeed::Git.create_notifications rec
end
end
end

View File

@ -1,7 +1,8 @@
# -*- encoding : utf-8 -*-
class ActivityFeedObserver < ActiveRecord::Observer
module Modules::Observers::ActivityFeed::Git
def self.create_notifications(record)
def after_create(record)
case record.class.to_s
when 'GitHook'
return unless record.project
@ -58,6 +59,7 @@ class ActivityFeedObserver < ActiveRecord::Observer
)
end
end
end
end
end