From 7d174fed9fc98832608fee3936e89e08b3b823da Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Mon, 30 Jul 2012 10:38:20 +0200 Subject: [PATCH] uses subclasses method instead of get_subclasses * removes get_subclasses * subclasses is now public --- app/models/enumeration.rb | 8 -------- app/views/enumerations/list.html.erb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index 80eb5ecc09..1c8df9fd71 100644 --- a/app/models/enumeration.rb +++ b/app/models/enumeration.rb @@ -86,14 +86,6 @@ class Enumeration < ActiveRecord::Base def to_s; name end - # Returns the Subclasses of Enumeration. Each Subclass needs to be - # required in development mode. - # - # Note: subclasses is protected in ActiveRecord - def self.get_subclasses - @@subclasses[Enumeration] - end - # Does the +new+ Hash override the previous Enumeration? def self.overridding_change?(new, previous) if (same_active_state?(new['active'], previous.active)) && same_custom_values?(new,previous) diff --git a/app/views/enumerations/list.html.erb b/app/views/enumerations/list.html.erb index 64ab4f6b4a..ddf0b97b25 100644 --- a/app/views/enumerations/list.html.erb +++ b/app/views/enumerations/list.html.erb @@ -1,6 +1,6 @@

<%=l(:label_enumerations)%>

-<% Enumeration.get_subclasses.each do |klass| %> +<% Enumeration.subclasses.each do |klass| %>

<%= l(klass::OptionName) %>

<% enumerations = klass.shared %>