module ActiveScaffold::Bridges::RecordSelect::Helpers::SearchColumnHelpers

Public Instance Methods

active_scaffold_search_record_select(column, options) click to toggle source
# File lib/active_scaffold/bridges/record_select/helpers.rb, line 68
def active_scaffold_search_record_select(column, options)
  value = field_search_record_select_value(column)
  active_scaffold_record_select(column, options, value, column.options[:multiple])
end
field_search_record_select_value(column) click to toggle source
# File lib/active_scaffold/bridges/record_select/helpers.rb, line 73
def field_search_record_select_value(column)
  begin
    value = field_search_params[column.name]
    unless value.blank?
      if column.options[:multiple]
        column.association.klass.find value.collect!(&:to_i)
      else
        column.association.klass.find(value.to_i)
      end
    end
  rescue Exception => e
    logger.error Time.now.to_s + "Sorry, we are not that smart yet. Attempted to restore search values to search fields but instead got -- #{e.inspect} -- on the ActiveScaffold column = :#{column.name} in #{@controller.class}"
    raise e
  end
end