-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add append info to payload #1109
Conversation
super | ||
payload[:user_id] = try(:current_user).try(:id) | ||
payload[:organization_id] = try(:current_organization).try(:id) | ||
payload[:app] = try(:current_organization).name |
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.
I don't think we need try in any of these cases
@@ -9,6 +9,18 @@ class ApplicationController < ActionController::Base | |||
helper Decidim::TranslationsHelper | |||
helper Decidim::DecidimFormHelper | |||
helper Decidim::ReplaceButtonsHelper | |||
|
|||
def append_info_to_payload(payload) |
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.
This method needs to be in all base/top controllers. Extract it to a concern.
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.
Why not move it to Decidim::ApplicationController
? I think everything inherits from this one.
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.
@mrcasals Admin & System inherit from ActionController::Base
8c03542
to
408dad3
Compare
Codecov Report
@@ Coverage Diff @@
## master #1109 +/- ##
==========================================
+ Coverage 97.17% 97.18% +<.01%
==========================================
Files 413 414 +1
Lines 6912 6930 +18
==========================================
+ Hits 6717 6735 +18
Misses 195 195
Continue to review full report at Codecov.
|
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.
Isn't system missing or does it inherit from core app controller?
def append_info_to_payload(payload) | ||
super | ||
payload[:user_id] = current_user.try(:id) | ||
payload[:organization_id] = current_organization.try(:id) |
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.
No try
def append_info_to_payload(payload) | ||
super | ||
payload[:user_id] = current_user.try(:id) | ||
payload[:organization_id] = current_organization.try(:id) |
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.
No try
I understood we want it removed from our conversation offline. |
408dad3
to
57832dd
Compare
fbb4940
to
565cf58
Compare
@Dor3nz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @oriolgual and @mrcasals to be potential reviewers. |
Niiice. |
* Opening commit 🚧 * Don't display follows, scopes, and types on cards * Fix offenses * User super * Fix tests * Fix offenses
📌 Related Issues
Add lograge for json logs AjuntamentdeBarcelona/decidim-barcelona#78
👻 GIF