gitlab-org--gitlab-foss/app/models/activity_observer.rb
2012-02-28 16:01:14 +02:00

12 lines
304 B
Ruby

class ActivityObserver < ActiveRecord::Observer
observe :issue, :merge_request, :note
def after_create(record)
Event.create(
:project => record.project,
:target_id => record.id,
:target_type => record.class.name,
:action => Event.determine_action(record)
)
end
end