Commit 3ffe1796e20643e7c19ff638970724cd55c08896
1 parent
47b2e79b
Exists in
staging
and in
39 other branches
rails4.1: temporaraly removed :finder_sql as it is not supported anymore
Fix this later, now we need to boot the app
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
vendor/plugins/action_tracker_has_comments/init.rb
@@ -3,9 +3,10 @@ | @@ -3,9 +3,10 @@ | ||
3 | Rails.configuration.to_prepare do | 3 | Rails.configuration.to_prepare do |
4 | ActionTracker::Record.module_eval do | 4 | ActionTracker::Record.module_eval do |
5 | 5 | ||
6 | - has_many :comments, :class_name => 'Comment', :foreign_key => 'source_id', :dependent => :destroy, | ||
7 | - :finder_sql => Proc.new { %Q{SELECT * FROM comments WHERE #{conditions_for_comments} ORDER BY created_at ASC}}, | ||
8 | - :counter_sql => Proc.new { %Q{SELECT COUNT(*) FROM comments WHERE #{conditions_for_comments}} } | 6 | + has_many :comments, :class_name => 'Comment', :foreign_key => 'source_id', :dependent => :destroy |
7 | + #FIXME rails 4.1 removes finder_sql | ||
8 | + #:finder_sql => Proc.new { %Q{SELECT * FROM comments WHERE #{conditions_for_comments} ORDER BY created_at ASC}}, | ||
9 | + #:counter_sql => Proc.new { %Q{SELECT COUNT(*) FROM comments WHERE #{conditions_for_comments}} } | ||
9 | 10 | ||
10 | def conditions_for_comments | 11 | def conditions_for_comments |
11 | type, id = (self.target_type == 'Article' ? ['Article', self.target_id] : [self.class.to_s, self.id]) | 12 | type, id = (self.target_type == 'Article' ? ['Article', self.target_id] : [self.class.to_s, self.id]) |