Sha256: 1a4e4390fbbebdc362eb99d4e28250e2e8813484bb3e9dcbc6858858f2d3bb6d

Contents?: true

Size: 611 Bytes

Versions: 12

Compression:

Stored size: 611 Bytes

Contents

module Datagrid::Filters::SelectOptions

  def select(object = nil)
    unless object
      Datagrid::Utils.warn_once("#{self.class.name}#select without argument is deprecated")
    end
    select = self.options[:select]
    if select.is_a?(Symbol)
      object.send(select)
    elsif select.respond_to?(:call)
      Datagrid::Utils.apply_args(object, &select)
    else
      select
    end
  end

  def include_blank
    unless prompt
      options.has_key?(:include_blank) ? options[:include_blank] : !multiple?
    end
  end
  
  def prompt
    options.has_key?(:prompt) ? options[:prompt] : false
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
datagrid-1.5.1 lib/datagrid/filters/select_options.rb
datagrid-1.5.0 lib/datagrid/filters/select_options.rb
datagrid-1.4.4 lib/datagrid/filters/select_options.rb
datagrid-1.4.3 lib/datagrid/filters/select_options.rb
datagrid-1.4.2 lib/datagrid/filters/select_options.rb
datagrid-1.4.1 lib/datagrid/filters/select_options.rb
datagrid-1.4.0 lib/datagrid/filters/select_options.rb
datagrid-1.3.9 lib/datagrid/filters/select_options.rb
datagrid-1.3.7 lib/datagrid/filters/select_options.rb
datagrid-1.3.6 lib/datagrid/filters/select_options.rb
datagrid-1.3.5 lib/datagrid/filters/select_options.rb
datagrid-1.3.4 lib/datagrid/filters/select_options.rb