Merge commit 'master' into discussions

Conflicts:
	app/assets/stylesheets/sections/notes.scss
	app/contexts/notes/load_context.rb
	app/models/project.rb
	app/observers/note_observer.rb
	app/roles/votes.rb
	app/views/commit/show.html.haml
	app/views/merge_requests/_show.html.haml
	app/views/merge_requests/diffs.js.haml
	app/views/merge_requests/show.js.haml
	app/views/notes/_note.html.haml
	features/steps/project/project_merge_requests.rb
	spec/models/note_spec.rb
This commit is contained in:
Riyad Preukschas 2013-01-15 00:52:25 +01:00
commit 3022786948
930 changed files with 80374 additions and 103682 deletions

View file

@ -3,7 +3,7 @@ class IssueObserver < ActiveRecord::Observer
def after_create(issue)
if issue.assignee && issue.assignee != current_user
Notify.new_issue_email(issue.id).deliver
Notify.delay.new_issue_email(issue.id)
end
end
@ -16,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer
if status
Note.create_status_change_note(issue, current_user, status)
[issue.author, issue.assignee].compact.each do |recipient|
Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user.id).deliver
Notify.delay.issue_status_changed_email(recipient.id, issue.id, status, current_user.id)
end
end
end
@ -27,7 +27,7 @@ class IssueObserver < ActiveRecord::Observer
recipient_ids = [issue.assignee_id, issue.assignee_id_was].keep_if {|id| id && id != current_user.id }
recipient_ids.each do |recipient_id|
Notify.reassigned_issue_email(recipient_id, issue.id, issue.assignee_id_was).deliver
Notify.delay.reassigned_issue_email(recipient_id, issue.id, issue.assignee_id_was)
end
end
end

View file

@ -1,12 +1,12 @@
class KeyObserver < ActiveRecord::Observer
include GitHost
include Gitolited
def after_save(key)
git_host.set_key(key.identifier, key.key, key.projects)
gitolite.set_key(key.identifier, key.key, key.projects)
end
def after_destroy(key)
return if key.is_deploy_key && !key.last_deploy?
git_host.remove_key(key.identifier, key.projects)
gitolite.remove_key(key.identifier, key.projects)
end
end

View file

@ -3,7 +3,7 @@ class MergeRequestObserver < ActiveRecord::Observer
def after_create(merge_request)
if merge_request.assignee && merge_request.assignee != current_user
Notify.new_merge_request_email(merge_request.id).deliver
Notify.delay.new_merge_request_email(merge_request.id)
end
end
@ -25,7 +25,7 @@ class MergeRequestObserver < ActiveRecord::Observer
recipients_ids.delete current_user.id
recipients_ids.each do |recipient_id|
Notify.reassigned_merge_request_email(recipient_id, merge_request.id, merge_request.assignee_id_was).deliver
Notify.delay.reassigned_merge_request_email(recipient_id, merge_request.id, merge_request.assignee_id_was)
end
end
end

View file

@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer
notify_team(note)
elsif note.notify_author
# Notify only author of resource
Notify.note_commit_email(note.noteable.author_email, note.id).deliver
Notify.delay.note_commit_email(note.noteable.author_email, note.id)
else
# Otherwise ignore it
nil
@ -26,7 +26,7 @@ class NoteObserver < ActiveRecord::Observer
if Notify.respond_to? notify_method
team_without_note_author(note).map do |u|
Notify.send(notify_method, u.id, note.id).deliver
Notify.delay.send(notify_method, u.id, note.id)
end
end
end

View file

@ -2,7 +2,7 @@ class UserObserver < ActiveRecord::Observer
def after_create(user)
log_info("User \"#{user.name}\" (#{user.email}) was created")
Notify.new_user_email(user.id, user.password).deliver
Notify.delay.new_user_email(user.id, user.password)
end
def after_destroy user
@ -14,7 +14,7 @@ class UserObserver < ActiveRecord::Observer
if user.namespace
user.namespace.update_attributes(path: user.username)
else
user.create_namespace!(path: user.username, name: user.name)
user.create_namespace!(path: user.username, name: user.username)
end
end
end

View file

@ -1,7 +1,7 @@
class UsersProjectObserver < ActiveRecord::Observer
def after_commit(users_project)
return if users_project.destroyed?
Notify.project_access_granted_email(users_project.id).deliver
Notify.delay.project_access_granted_email(users_project.id)
end
def after_create(users_project)