-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update application_controller.rb #2
base: master
Are you sure you want to change the base?
Conversation
PR SummaryThis pull request updates the Key Findings
Pull Request Impact: 0 🔄 File Changes Overview
📜 Blar InstructionsBlar Commands
Tags Explanation
|
|
||
# Confirms a logged-in user. | ||
def logged_in_user | ||
unless logged_in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Error 🐛 Bug
- The lines
store_location
,flash[:danger] = "Please log in."
, andredirect_to login_url
are now directly inside the private section of theApplicationController
. - These lines are effectively orphaned as they are not wrapped in any method.
- In Ruby, code defined in the class body executes at class load time.
- Therefore, these statements will execute when the
ApplicationController
class is loaded, which can lead to unintended side effects. - The original method definition (
logged_in_user
) and its guard have been removed, contributing to this issue.
❕ It looks like we couldn't find any design patterns in the Wiki for this repository. Let's add some at: app.blar.io/wiki |
PR SummaryThis pull request refactors the ApplicationController by removing the Key Findings
Pull Request Impact: 0 🔄 File Changes Overview
📊 Impact SummaryThis tables shows the impact of the changes in the codebase
📜 Blar InstructionsBlar Commands
Tags Explanation
|
✅ No debugger issues found 🐛 |
No description provided.