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 34
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

  # start with the ActionLink defined globally
  @link = self.class.link.clone
  @action_group = self.class.action_group.clone if self.class.action_group
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 42
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) and c.searchable? and c.column and c.column[:type] == :string}.compact
  end
  @columns
end
live?() click to toggle source
# File lib/active_scaffold/config/search.rb, line 69
def live?
  @live
end