app/helpers/extface/devices_helper.rb in extface-0.2.4 vs app/helpers/extface/devices_helper.rb in extface-0.2.5

- old
+ new

@@ -2,20 +2,20 @@ module DevicesHelper def subdrivers(object) [].tap do |drivers| object.subclasses.each do |s| - drivers << s + drivers << s unless s.abstract_class drivers << subdrivers(s) if s.subclasses.any? end end end def options_for_drivers Extface::Engine.eager_load! if Rails.env.development? [].tap do |drivers| Extface::Driver.subclasses.each do |s| - drivers << s + drivers << s unless s.abstract_class drivers << subdrivers(s) end end.flatten.group_by{ |x| x::GROUP }.sort.collect{ |group, drivers| [group, drivers.collect{ |d| [d::NAME, d.to_s] }.sort ] } end end