Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

remove unnecessary file and optimize query #31

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

Closed
SuMingXuan wants to merge 2 commits into rails-engine:master from SuMingXuan:master
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/controllers/notifications/notifications_controller.rb
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ module Notifications
class NotificationsController < Notifications::ApplicationController
def index
@notifications = notifications.includes(:actor).order("id desc").page(params[:page])
@notification_groups = @notifications.group_by { |note| note.created_at.to_date }

unread_ids = @notifications.reject(&:read?).select(&:id)
unread_ids = @notifications.unread.ids
Notification.read!(current_user, unread_ids)

@notification_groups = @notifications.group_by { |note| note.created_at.to_date }
end

def read
Expand Down
12 changes: 0 additions & 12 deletions lib/notifications/base.rb
View file Open in desktop

This file was deleted.

AltStyle によって変換されたページ (->オリジナル) /