Module: ActiveScaffold::Bridges::RecordSelect::Helpers::SearchColumnHelpers
- Defined in:
- lib/active_scaffold/bridges/record_select/helpers.rb
Instance Method Summary collapse
- #active_scaffold_search_record_select(column, options) ⇒ Object
- #field_search_record_select_value(column, value) ⇒ Object
Instance Method Details
#active_scaffold_search_record_select(column, options) ⇒ Object
69 70 71 72 |
# File 'lib/active_scaffold/bridges/record_select/helpers.rb', line 69 def active_scaffold_search_record_select(column, ) value = field_search_record_select_value(column, [:value]) active_scaffold_record_select([:object], column, , value, column.[:multiple]) end |
#field_search_record_select_value(column, value) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/active_scaffold/bridges/record_select/helpers.rb', line 74 def field_search_record_select_value(column, value) return if value.blank? if column.[:multiple] column.association.klass.find value.collect!(&:to_i) else column.association.klass.find(value.to_i) end rescue StandardError => e logger.error "#{e.class.name}: #{e.} -- Sorry, we are not that smart yet. Attempted to restore search values to search fields :#{column.name} in #{controller.class}" raise e end |