Class: ActiveScaffold::Config::Search

Inherits:
Base show all
Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb

Constant Summary collapse

ActiveScaffold::DataStructures::ActionLink.new('show_search', :label => :search, :type => :table, :security_method => :search_authorized?)
@@full_text_search =
true

Instance Attribute Summary collapse

Attributes inherited from Base

#user

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#crud_type, #formats, #formats=, inherited

Methods included from ActiveScaffold::Configurable

#configure, #method_missing

Constructor Details

#initialize(core_config) ⇒ Search

Returns a new instance of Search.



5
6
7
8
9
10
11
12
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/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

Parameters:

  • value

    the value to set the attribute full_text_search to.



44
45
46
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb', line 44

def full_text_search=(value)
  @full_text_search = value
end

the ActionLink for this action



50
51
52
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb', line 50

def link
  @link
end

Class Method Details

.full_text_search?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb', line 22

def self.full_text_search?
  @@full_text_search
end

Instance Method Details

#columnsObject

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/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/search.rb', line 39

def columns=(val)
  @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val)
  @columns.action = self
end

#full_text_search?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb', line 45

def full_text_search?
  @full_text_search
end