From 3ffe1796e20643e7c19ff638970724cd55c08896 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Sun, 28 Sep 2014 22:02:13 -0300 Subject: [PATCH] rails4.1: temporaraly removed :finder_sql as it is not supported anymore --- vendor/plugins/action_tracker_has_comments/init.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vendor/plugins/action_tracker_has_comments/init.rb b/vendor/plugins/action_tracker_has_comments/init.rb index be92a92..4976123 100644 --- a/vendor/plugins/action_tracker_has_comments/init.rb +++ b/vendor/plugins/action_tracker_has_comments/init.rb @@ -3,9 +3,10 @@ Rails.configuration.to_prepare do ActionTracker::Record.module_eval do - has_many :comments, :class_name => 'Comment', :foreign_key => 'source_id', :dependent => :destroy, - :finder_sql => Proc.new { %Q{SELECT * FROM comments WHERE #{conditions_for_comments} ORDER BY created_at ASC}}, - :counter_sql => Proc.new { %Q{SELECT COUNT(*) FROM comments WHERE #{conditions_for_comments}} } + has_many :comments, :class_name => 'Comment', :foreign_key => 'source_id', :dependent => :destroy + #FIXME rails 4.1 removes finder_sql + #:finder_sql => Proc.new { %Q{SELECT * FROM comments WHERE #{conditions_for_comments} ORDER BY created_at ASC}}, + #:counter_sql => Proc.new { %Q{SELECT COUNT(*) FROM comments WHERE #{conditions_for_comments}} } def conditions_for_comments type, id = (self.target_type == 'Article' ? ['Article', self.target_id] : [self.class.to_s, self.id]) -- libgit2 0.21.2