DRY code. always a pleasure to see it in the wild

pull/6827/head
jwollert 14 years ago
parent a345a9b038
commit 932720c482
  1. 4
      lib/report/chainable.rb
  2. 4
      lib/report/filter/base.rb
  3. 4
      lib/report/group_by/base.rb

@ -78,6 +78,10 @@ class Report < ActiveRecord::Base
engine.chain_initializer.push block
end
def self.cache_key
@cache_key ||= underscore_name
end
inherited_attribute :label, :default => :translation_needed
inherited_attribute :properties, :list => true

@ -16,10 +16,6 @@ class Report::Filter
attr_accessor :values
def self.cache_key
@cache_key ||= underscore_name
end
def cache_key
self.class.cache_key + operator.to_s + Array(values).join(',')
end

@ -16,10 +16,6 @@ class Report::GroupBy
child.filter?
end
def self.cache_key
@cache_key ||= underscore_name
end
def cache_key
self.class.cache_key + type.to_s[0,1]
end

Loading…
Cancel
Save