Permalink
Browse files

Fixing bug with a named_scope of parents. Activerecord 2.3.14 doesn't…

… like this and enters an infinite loop while leaking memory.
  • Loading branch information...
1 parent 5fc17a0 commit 9fa6bba1b97b29ace0680bd01ead574355778509 @jtgeibel committed Nov 19, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/models/message.rb
View
@@ -8,7 +8,7 @@ class Message < ActiveRecord::Base
has_many :children, :class_name => "Message", :foreign_key => "parent_id"
has_many :message_threads
- named_scope :parents, :conditions => "parent_id IS NULL"
+ # named_scope :conversation_roots, :conditions => "parent_id IS NULL"
validates_presence_of :body, :subject
validates_presence_of :recipient, :message => "is invalid"
@@ -52,4 +52,4 @@ def self.new_reply(sender, message_thread = nil, params = {})
message
end
-end
+end

0 comments on commit 9fa6bba

Please sign in to comment.