diff --git a/app/models/report/chainable.rb b/app/models/report/chainable.rb index 3b0f469779..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 @@ -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 @@ -293,4 +293,4 @@ class Report < ActiveRecord::Base end end -end \ No newline at end of file +end 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