Class: ActiveScaffold::Config::AdvancedSearch

Inherits:
Base
  • Object
show all
Defined in:
lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb

Constant Summary collapse

ActiveScaffold::DataStructures::ActionLink.new('show_advanced_search', :label => 'Advanced Search', :type => :table, :security_method => :advanced_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) ⇒ AdvancedSearch

Returns a new instance of AdvancedSearch.



7
8
9
10
11
12
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 7

def initialize(core_config)
  @core = core_config

  @full_text_search = self.class.full_text_search?
  @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.



25
26
27
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 25

def full_text_search=(value)
  @full_text_search = value
end

Returns the value of attribute link.



17
18
19
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 17

def link
  @link
end

Class Method Details

.full_text_search?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 20

def self.full_text_search?
  @@full_text_search
end

Instance Method Details

#column_objectsObject



42
43
44
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 42

def column_objects
  @column_objects ||= @core.columns.select { |c| self.columns.include?(c.name) }
end

#columnsObject



30
31
32
33
34
35
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 30

def columns
  unless @columns
    self.columns = @core.columns.collect { |c| c.name if c.searchable? && c.column && (c.column.text? || (c.column.type == :integer) || (c.column.type == :boolean)) }.compact - [:id]
  end
  @columns
end

#columns=(val) ⇒ Object



37
38
39
40
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 37

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

#full_text_search?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb', line 26

def full_text_search?
  @full_text_search
end