Commit 5e5f147822b127d63458bde7a020cff9291e4e0a

Authored by Braulio Bhavamitra
1 parent b56a45db

rails4: replace includes with joins to fix query error

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/person.rb
@@ -71,7 +71,7 @@ class Person < Profile @@ -71,7 +71,7 @@ class Person < Profile
71 has_many :friends, :class_name => 'Person', :through => :friendships 71 has_many :friends, :class_name => 'Person', :through => :friendships
72 72
73 scope :online, -> { 73 scope :online, -> {
74 - includes(:user).where("users.chat_status != '' AND users.chat_status_at >= ?", DateTime.now - User.expires_chat_status_every.minutes) 74 + joins(:user).where("users.chat_status != '' AND users.chat_status_at >= ?", DateTime.now - User.expires_chat_status_every.minutes)
75 } 75 }
76 76
77 has_many :requested_tasks, :class_name => 'Task', :foreign_key => :requestor_id, :dependent => :destroy 77 has_many :requested_tasks, :class_name => 'Task', :foreign_key => :requestor_id, :dependent => :destroy