use extend self pattern instead of defining self.xxx methods all over the place

pull/6827/head
Philipp Tessenow 14 years ago
parent 064526a6f6
commit 1cf51a88d5
  1. 8
      app/models/report/filter.rb

@ -1,15 +1,17 @@
require "set"
module Report::Filter
def self.all
extend self
def all
@all ||= Set[]
end
def self.all_grouped
def all_grouped
all.group_by { |f| f.applies_for }.to_a.sort { |a,b| a.first.to_s <=> b.first.to_s }
end
def self.from_hash
def from_hash
raise NotImplementedError
end
end

Loading…
Cancel
Save