From 9e7bc3e1285231ee0d857f0abaf38778cde7e690 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Thu, 27 Jun 2013 14:38:04 +0200 Subject: [PATCH 1/2] removes uninformative comment --- lib/report/filter/base.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/report/filter/base.rb b/lib/report/filter/base.rb index 9818aa3bb0..4fe2f73682 100644 --- a/lib/report/filter/base.rb +++ b/lib/report/filter/base.rb @@ -170,8 +170,6 @@ class Report::Filter end def initialize(child = nil, options = {}) - # TODO: wtf? - #raise ArgumentError, "Child has to be a Filter." if child and not child.filter? @values = [] super end From 2967e30ae70a18d428dc16b04319fa2770326c71 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Thu, 27 Jun 2013 14:58:37 +0200 Subject: [PATCH 2/2] uses first descendant of ActiveRecord::Base to determine "ON" clause attribute --- lib/report/sql_statement.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/report/sql_statement.rb b/lib/report/sql_statement.rb index 7647880e84..f7410e567f 100644 --- a/lib/report/sql_statement.rb +++ b/lib/report/sql_statement.rb @@ -142,7 +142,7 @@ class Report::SqlStatement join_syntax = "LEFT OUTER JOIN %1$s ON %1$s.id = %2$s_id" list.each do |e| case e - when Class then joins << (join_syntax % [table_name_for(e), e.model_name.underscore]) + when Class then joins << (join_syntax % [table_name_for(e), e.lookup_ancestors.last.model_name.underscore]) when / / then joins << e when Symbol, String then joins << (join_syntax % [table_name_for(e), e]) when Hash then e.each { |k,v| joins << (join_syntax % [table_name_for(k), field_name_for(v)]) }