From fee9b1d0e3a1c24a0d79272c4471bcd53f462bd1 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Tue, 21 Dec 2010 18:15:37 +0100 Subject: [PATCH 1/3] make the singleton value group by shipped with the engine actually work --- app/models/report/group_by/singleton_value.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/report/group_by/singleton_value.rb b/app/models/report/group_by/singleton_value.rb index 61ac1f5103..197b9fcf80 100644 --- a/app/models/report/group_by/singleton_value.rb +++ b/app/models/report/group_by/singleton_value.rb @@ -1,5 +1,10 @@ class Report::GroupBy class SingletonValue < Base dont_display! + + def define_group(sql) + sql.select "1 as singleton_value" + sql.group_by "singleton_value" + end end end From 69e28a343b95370e9e061d99ffde76499a063f14 Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Wed, 22 Dec 2010 09:24:27 +0100 Subject: [PATCH 2/3] assign a default label for chainables --- app/models/report/chainable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/report/chainable.rb b/app/models/report/chainable.rb index 3b0f469779..b554725616 100644 --- a/app/models/report/chainable.rb +++ b/app/models/report/chainable.rb @@ -72,7 +72,7 @@ class Report < ActiveRecord::Base engine.chain_initializer.push block end - inherited_attribute :label + inherited_attribute :label, :default => :translation_needed inherited_attribute :properties, :list => true class << self From 1d4ebcd35723e1dd387f055d88f48f376acea117 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Tue, 4 Jan 2011 17:29:23 +0100 Subject: [PATCH 3/3] Fixing typos --- app/models/report/chainable.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/report/chainable.rb b/app/models/report/chainable.rb index b554725616..4b9a9f900e 100644 --- a/app/models/report/chainable.rb +++ b/app/models/report/chainable.rb @@ -1,5 +1,5 @@ -# Proviedes convinience layer and logic shared between GroupBy::Base and Filter::Base. -# Implements a dubble linked list (FIXME: is that the correct term?). +# Provides convinience layer and logic shared between GroupBy::Base and Filter::Base. +# Implements a double linked list (FIXME: is that the correct term?). class Report < ActiveRecord::Base class Chainable include Enumerable @@ -293,4 +293,4 @@ class Report < ActiveRecord::Base end end -end \ No newline at end of file +end