Feature #16006 » notify.patch
app/models/mail_handler.rb | ||
---|---|---|
193 | 193 |
:content => cleaned_up_text_body) |
194 | 194 |
message.author = user |
195 | 195 |
message.board = board |
196 |
message.save! |
|
197 | 196 |
add_attachments(message) |
197 |
message.save! |
|
198 | 198 |
logger.info "MailHandler: message ##{message.id} created by #{user}" if logger |
199 | 199 |
message |
200 | 200 |
end |
app/models/message.rb | ||
---|---|---|
45 | 45 |
after_create :add_author_as_watcher, :reset_counters! |
46 | 46 |
after_update :update_messages_board |
47 | 47 |
after_destroy :reset_counters! |
48 |
after_create :send_notification
|
|
48 |
after_commit :send_notification, :on => :create
|
|
49 | 49 | |
50 | 50 |
scope :visible, lambda {|*args| |
51 | 51 |
includes(:board => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_messages, *args)) |