Module: Netzke::Sequel::ComboboxOptions

Defined in:
lib/netzke/sequel/combobox_options.rb

Instance Method Summary collapse

Instance Method Details

#netzke_combo_options_for(column, query = "") ⇒ Object



4
5
6
7
# File 'lib/netzke/sequel/combobox_options.rb', line 4

def netzke_combo_options_for(column, query = "")
  ds = query.empty? ? self : filter(column.to_sym.ilike("#{query}%"))
  ds.select(column.to_sym).distinct.all.map &column.to_sym
end