class ActiveScaffold::Config::FieldSearch
Attributes
default_params[RW]
default search params default_params
= {:title => {“from”=>“test”, “to”=>“”, “opt”=>“%?%”}}
human_conditions[RW]
human conditions instead of just filtered you may show the user a humanized search condition statment
link[RW]
the ActionLink for this action
text_search[RW]
A flag for how the search should do full-text searching in the database:
-
:full: LIKE %?%
-
:start: LIKE ?%
-
:end: LIKE %?
-
false: LIKE ?
Default is :full
Public Class Methods
new(core_config)
click to toggle source
Calls superclass method
ActiveScaffold::Config::Base::new
# File lib/active_scaffold/config/field_search.rb, line 5 def initialize(core_config) super @text_search = self.class.text_search # 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/field_search.rb, line 34 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._inheritable if @core.columns.active_record_class.respond_to?(:lock_column) self.columns.exclude @core.columns.active_record_class.lock_column end end @columns end
optional_columns()
click to toggle source
# File lib/active_scaffold/config/field_search.rb, line 63 def optional_columns @optional_columns ||= [] end
optional_columns=(optionals)
click to toggle source
rarely searched columns may be placed in a hidden subgroup
# File lib/active_scaffold/config/field_search.rb, line 59 def optional_columns=(optionals) @optional_columns= Array(optionals) end