Class: ActiveScaffold::Config::LiveSearch
- Defined in:
- lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb
Constant Summary collapse
- @@link =
ActiveScaffold::DataStructures::ActionLink.new('show_search', :label => :search, :type => :table, :security_method => :search_authorized?)
- @@full_text_search =
true
Instance Attribute Summary collapse
-
#full_text_search ⇒ Object
writeonly
Sets the attribute full_text_search.
-
#link ⇒ Object
the ActionLink for this action.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#columns ⇒ Object
provides access to the list of columns specifically meant for the Search to use.
- #columns=(val) ⇒ Object
- #full_text_search? ⇒ Boolean
-
#initialize(core_config) ⇒ LiveSearch
constructor
A new instance of LiveSearch.
Methods inherited from Base
#crud_type, #formats, #formats=, inherited
Methods included from ActiveScaffold::Configurable
Constructor Details
#initialize(core_config) ⇒ LiveSearch
Returns a new instance of LiveSearch.
5 6 7 8 9 10 11 12 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb', line 5 def initialize(core_config) @core = core_config @full_text_search = self.class.full_text_search? # start with the ActionLink defined globally @link = self.class.link.clone end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable
Instance Attribute Details
#full_text_search=(value) ⇒ Object (writeonly)
Sets the attribute full_text_search
44 45 46 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb', line 44 def full_text_search=(value) @full_text_search = value end |
#link ⇒ Object
the ActionLink for this action
50 51 52 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb', line 50 def link @link end |
Class Method Details
.full_text_search? ⇒ Boolean
22 23 24 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb', line 22 def self.full_text_search? @@full_text_search end |
Instance Method Details
#columns ⇒ Object
provides access to the list of columns specifically meant for the Search to use
31 32 33 34 35 36 37 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb', line 31 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 c.searchable? and c.column and c.column.text?}.compact end @columns end |
#columns=(val) ⇒ Object
39 40 41 42 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb', line 39 def columns=(val) @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val) @columns.action = self end |
#full_text_search? ⇒ Boolean
45 46 47 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb', line 45 def full_text_search? @full_text_search end |