Sha256: 073702d0d1a9e3dd943773a140d9f16e154efa023a7a8d4b62032c4107fe1e6e
Contents?: true
Size: 629 Bytes
Versions: 14
Compression:
Stored size: 629 Bytes
Contents
module Extface module DevicesHelper def subdrivers(object) [].tap do |drivers| object.subclasses.each do |s| drivers << s 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 << 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 end
Version data entries
14 entries across 14 versions & 1 rubygems