refactor observers. Added BaseObserver with helper methods

This commit is contained in:
Dmitriy Zaporozhets 2013-03-26 18:11:38 +02:00
parent 6abf58466f
commit ce0945efcd
9 changed files with 26 additions and 45 deletions

View file

@ -1,4 +1,4 @@
class IssueObserver < ActiveRecord::Observer
class IssueObserver < BaseObserver
cattr_accessor :current_user
def after_create(issue)
@ -27,8 +27,4 @@ class IssueObserver < ActiveRecord::Observer
def create_note(issue)
Note.create_status_change_note(issue, current_user, issue.state)
end
def notification
NotificationService.new
end
end