Remove some calls to all. They are not required, and Rails4 raises warnings about them.

This commit is contained in:
Stephan Kaag
2013-07-22 20:44:11 +02:00
parent 112b9f9c2a
commit 0e3b8fbb24
9 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -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 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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|