mirror of
https://github.com/discourse/discourse.git
synced 2026-08-26 21:27:16 -05:00
Remove some calls to all. They are not required, and Rails4 raises warnings about them.
This commit is contained in:
@@ -16,7 +16,7 @@ class Admin::EmailController < Admin::AdminController
|
||||
end
|
||||
|
||||
def logs
|
||||
@email_logs = EmailLog.limit(50).includes(:user).order('created_at desc').all
|
||||
@email_logs = EmailLog.limit(50).includes(:user).order('created_at desc').to_a
|
||||
render_serialized(@email_logs, EmailLogSerializer)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Admin::GroupsController < Admin::AdminController
|
||||
def index
|
||||
groups = Group.order(:name).all
|
||||
groups = Group.order(:name).to_a
|
||||
render_serialized(groups, BasicGroupSerializer)
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ class NotificationsController < ApplicationController
|
||||
before_filter :ensure_logged_in
|
||||
|
||||
def index
|
||||
notifications = current_user.notifications.recent.includes(:topic).all.to_a
|
||||
notifications = current_user.notifications.recent.includes(:topic)
|
||||
|
||||
if notifications.present?
|
||||
notifications += current_user.notifications
|
||||
@@ -11,9 +11,9 @@ class NotificationsController < ApplicationController
|
||||
.where(read: false, notification_type: Notification.types[:private_message])
|
||||
.where('id < ?', notifications.last.id)
|
||||
.limit(5)
|
||||
.to_a
|
||||
end
|
||||
|
||||
notifications = notifications.to_a
|
||||
current_user.saw_notification_id(notifications.first.id) if notifications.present?
|
||||
current_user.reload
|
||||
current_user.publish_notifications_state
|
||||
|
||||
@@ -31,7 +31,7 @@ class PostActionsController < ApplicationController
|
||||
users = User.select(['null as post_url','users.id', 'users.username', 'users.username_lower', 'users.email','post_actions.related_post_id'])
|
||||
.joins(:post_actions)
|
||||
.where(['post_actions.post_id = ? and post_actions.post_action_type_id = ? and post_actions.deleted_at IS NULL', @post.id, @post_action_type_id])
|
||||
.all
|
||||
.to_a
|
||||
|
||||
urls = Post.urls(users.map{|u| u.related_post_id})
|
||||
users.each do |u|
|
||||
|
||||
Reference in New Issue
Block a user