-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
added total contributors for all time #3695
Conversation
r? @jywarren @sagarpreet-chadha @SidharthBansal @publiclab/mentors I'm facing this "Unescaped model attribute" issue in the test case. I have never used Ruby I18n in the views. Please help me to resolve this issue. I need some help in catching this query, I'm not sure, how should I proceed! |
Generated by 🚫 Danger |
Ah, this is a style or security warning, let me check! |
Aha, I've approved it and you are ok now. I think this may need some caching to not cause trouble... Perhaps someone from @publiclab/mentors with experience in caching could help you set up a daily cache? You can also search the codebase for examples of caching in views. Great work here! Just a few more steps! |
app/controllers/stats_controller.rb
Outdated
@@ -81,5 +81,6 @@ def index | |||
|
|||
@all_notes = nids.uniq.length | |||
@all_contributors = users.uniq.length | |||
@all_time_contributors = User.count_all_time_contributor |
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.
cache could wrap this line
Hi! Just looking to see if I can help you get a cache installed here too. One way to do it is a cache in the controller, so it doesn't get generated too often. So that would like kind of like: plots2/app/controllers/home_controller.rb Lines 163 to 165 in 062ff10
It does need a unique key, so you could put Then we should add, after the number is shown in the template, a note like You can put the caching around the line marked in my other comment. More caching docs are here: https://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html I hope this helps! |
r? @jywarren @sagarpreet-chadha @SidharthBansal I think this should work fine now :) |
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.
Awesome !!!
Can you post a screenshot ? Thanks !
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.
Well done
Very well done, thank you!!! 👍 🎉 We'd love your help with a new project if you're interested!!! |
Perhaps this one would be interesting? We'd very much like to solve it: #1097 |
* added total contributors for all time * fixes linting issues * Added Cache to all time contributors * Changed the stats view template
Fixes #3499
rake test
@publiclab/reviewers
for help, in a comment below