Skip to content
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

Refactor ActiveRecord usage in dashboard controller #443

Closed
chrisma opened this issue Mar 6, 2019 · 1 comment
Closed

Refactor ActiveRecord usage in dashboard controller #443

chrisma opened this issue Mar 6, 2019 · 1 comment
Assignees
Labels
prio: low This is a low priority issue. refactoring

Comments

@chrisma
Copy link
Contributor

chrisma commented Mar 6, 2019

app/controllers/dashboard_controller.rb

@notifications = Notification.where(user: current_user).slice(0, number_of_notifications)

loads all notifications and then discards. Instead: https://guides.rubyonrails.org/active_record_querying.html#limit-and-offset

@chrisma chrisma added prio: low This is a low priority issue. refactoring labels Mar 6, 2019
@chrisma
Copy link
Contributor Author

chrisma commented Mar 6, 2019

max_shown_vms and number_of_notifications might not be necessary.

Idea: Return all items and hide the majority in the UI...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio: low This is a low priority issue. refactoring
Projects
None yet
Development

No branches or pull requests

2 participants