Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
f13604a2f794
Commit
6d92aa6d
authored
Jun 24, 2012
by
randx
Browse files
Fix IssueObserver current_user assign. Refactored observers
parent
bad3431b8abe
Changes
7
Show whitespace changes
Inline
Side-by-side
app/controllers/application_controller.rb
View file @
f13604a2
class
ApplicationController
<
ActionController
::
Base
before_filter
:authenticate_user!
before_filter
:reject_blocked!
before_filter
:set_current_user_for_mailer
,
:check_token_auth
before_filter
:set_current_user_for_mailer
before_filter
:check_token_auth
before_filter
:set_current_user_for_observers
protect_from_forgery
helper_method
:abilities
,
:can?
rescue_from
Gitlab
::
Gitolite
::
AccessDenied
do
|
exception
|
...
...
@@ -58,6 +62,10 @@ def set_current_user_for_mailer
MailerObserver
.
current_user
=
current_user
end
def
set_current_user_for_observers
IssueObserver
.
current_user
=
current_user
end
def
abilities
@abilities
||=
Six
.
new
end
...
...
app/
model
s/activity_observer.rb
→
app/
observer
s/activity_observer.rb
View file @
f13604a2
File moved
app/
model
s/issue_observer.rb
→
app/
observer
s/issue_observer.rb
View file @
f13604a2
File moved
app/
model
s/key_observer.rb
→
app/
observer
s/key_observer.rb
View file @
f13604a2
File moved
app/
model
s/mailer_observer.rb
→
app/
observer
s/mailer_observer.rb
View file @
f13604a2
File moved
app/
model
s/project_observer.rb
→
app/
observer
s/project_observer.rb
View file @
f13604a2
File moved
app/
model
s/user_observer.rb
→
app/
observer
s/user_observer.rb
View file @
f13604a2
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment