Class: AdminAssistant::IndexSettings::SearchSettings

Inherits:
AbstractSettings show all
Defined in:
lib/admin_assistant/builder.rb

Defined Under Namespace

Classes: DefaultSearchMatchesOn

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractSettings

#[]

Constructor Details

#initialize(admin_assistant) ⇒ SearchSettings

Returns a new instance of SearchSettings.


289
290
291
292
293
294
# File 'lib/admin_assistant/builder.rb', line 289

def initialize(admin_assistant)
  super
  @column_names = []
  @default_search_includes = []
  @include_params_in_form = false
end

Instance Attribute Details

#column_namesObject (readonly)

Returns the value of attribute column_names


287
288
289
# File 'lib/admin_assistant/builder.rb', line 287

def column_names
  @column_names
end

#include_params_in_formObject

Returns the value of attribute include_params_in_form


286
287
288
# File 'lib/admin_assistant/builder.rb', line 286

def include_params_in_form
  @include_params_in_form
end

Instance Method Details

#column_config_fieldsObject


296
297
298
299
300
301
# File 'lib/admin_assistant/builder.rb', line 296

def column_config_fields
  {:blank_checkbox => :accessor, :comparators => :accessor,
   :compare_to_range => :accessor, :conditions => :block,
   :field_type => :accessor,
   :match_text_fields_for_association => :boolean}
end

#columns(*c) ⇒ Object


303
304
305
# File 'lib/admin_assistant/builder.rb', line 303

def columns(*c)
  @column_names = c
end

#default_search_matches_on(*includes) ⇒ Object


307
308
309
310
311
312
313
# File 'lib/admin_assistant/builder.rb', line 307

def default_search_matches_on(*includes)
  if includes.empty?
    DefaultSearchMatchesOn.new(@admin_assistant)
  else
    @admin_assistant.default_search_matches_on = includes
  end
end