class ActiveScaffold::Config::Search

Attributes

live[W]

whether submits the search as you type

split_terms[RW]

Public Class Methods

live?() click to toggle source
# File lib/active_scaffold/config/search.rb, line 29
def self.live?
  @@live
end
new(core_config) click to toggle source
Calls superclass method ActiveScaffold::Config::Base.new
# File lib/active_scaffold/config/search.rb, line 5
def initialize(core_config)
  super
  @text_search = self.class.text_search
  @live = self.class.live?
  @split_terms = self.class.split_terms
end

Public Instance Methods

columns() click to toggle source

provides access to the list of columns specifically meant for the Search to use

# File lib/active_scaffold/config/search.rb, line 41
def columns
  # we want to delay initializing to the @core.columns set for as long as possible. Too soon and .search_sql will not be available to .searchable?
  unless @columns
    self.columns = @core.columns.collect { |c| c.name if @core.columns._inheritable.include?(c.name) && c.searchable? && c.association.nil? && c.text? }.compact
  end
  @columns
end
live?() click to toggle source
# File lib/active_scaffold/config/search.rb, line 64
def live?
  @live
end