Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
616fbd02
Commit
616fbd02
authored
Oct 26, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rails5: env is deprecated and will be removed from Rails 5.1
parent
64c35c74
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-1
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+1
-1
changelogs/unreleased/rails5-env-deprecated.yml
changelogs/unreleased/rails5-env-deprecated.yml
+5
-0
No files found.
app/controllers/application_controller.rb
View file @
616fbd02
...
@@ -163,7 +163,7 @@ class ApplicationController < ActionController::Base
...
@@ -163,7 +163,7 @@ class ApplicationController < ActionController::Base
def
log_exception
(
exception
)
def
log_exception
(
exception
)
Raven
.
capture_exception
(
exception
)
if
sentry_enabled?
Raven
.
capture_exception
(
exception
)
if
sentry_enabled?
backtrace_cleaner
=
Gitlab
.
rails5?
?
env
[
"action_dispatch.backtrace_cleaner"
]
:
env
backtrace_cleaner
=
Gitlab
.
rails5?
?
request
.
env
[
"action_dispatch.backtrace_cleaner"
]
:
env
application_trace
=
ActionDispatch
::
ExceptionWrapper
.
new
(
backtrace_cleaner
,
exception
).
application_trace
application_trace
=
ActionDispatch
::
ExceptionWrapper
.
new
(
backtrace_cleaner
,
exception
).
application_trace
application_trace
.
map!
{
|
t
|
"
#{
t
}
\n
"
}
application_trace
.
map!
{
|
t
|
"
#{
t
}
\n
"
}
logger
.
error
"
\n
#{
exception
.
class
.
name
}
(
#{
exception
.
message
}
):
\n
#{
application_trace
.
join
}
"
logger
.
error
"
\n
#{
exception
.
class
.
name
}
(
#{
exception
.
message
}
):
\n
#{
application_trace
.
join
}
"
...
...
app/controllers/sessions_controller.rb
View file @
616fbd02
...
@@ -104,7 +104,7 @@ class SessionsController < Devise::SessionsController
...
@@ -104,7 +104,7 @@ class SessionsController < Devise::SessionsController
end
end
def
failed_login?
def
failed_login?
(
options
=
env
[
"warden.options"
])
&&
options
[
:action
]
==
"unauthenticated"
(
options
=
request
.
env
[
"warden.options"
])
&&
options
[
:action
]
==
"unauthenticated"
end
end
# Handle an "initial setup" state, where there's only one user, it's an admin,
# Handle an "initial setup" state, where there's only one user, it's an admin,
...
...
changelogs/unreleased/rails5-env-deprecated.yml
0 → 100644
View file @
616fbd02
---
title
:
'
Rails5:
env
is
deprecated
and
will
be
removed
from
Rails
5.1'
merge_request
:
22626
author
:
Jasper Maes
type
:
other
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