Class: ActiveScaffold::Config::FieldSearch
- Defined in:
- lib/active_scaffold/config/field_search.rb
Constant Summary collapse
- NO_COLUMNS =
[].freeze
- @@link =
ActiveScaffold::DataStructures::ActionLink.new('show_search', :label => :search, :type => :collection, :security_method => :search_authorized?, :ignore_method => :field_search_ignore?)
- @@text_search =
:full
- @@human_conditions =
false
false
Constants inherited from Base
Instance Attribute Summary collapse
-
#default_params ⇒ Object
default search params default_params = => {“from”=>“test”, “to”=>“”, “opt”=>“%?%”}.
-
#floating_footer ⇒ Object
whether footer should float when form is too long to fit in the screen, so footer is always available while scrolling.
-
#group_options ⇒ Object
add array of columns as options for group by to get aggregated listings.
-
#grouped_columns ⇒ Object
columns to display on aggregated listing.
-
#human_conditions ⇒ Object
human conditions instead of just filtered you may show the user a humanized search condition statment.
-
#link ⇒ Object
the ActionLink for this action.
-
#text_search ⇒ Object
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.
Attributes inherited from Base
#action_group, #core, #formats, #user_settings_key
Instance Method Summary collapse
-
#initialize(core_config) ⇒ FieldSearch
constructor
A new instance of FieldSearch.
- #optional_columns ⇒ Object
-
#optional_columns=(optionals) ⇒ Object
rarely searched columns may be placed in a hidden subgroup.
Methods inherited from Base
#crud_type, inherited, #label, #model_id, #new_user_settings, #setup_user_setting_key, #user
Methods included from ActiveScaffold::Configurable
#configure, #method_missing, #respond_to_missing?
Constructor Details
#initialize(core_config) ⇒ FieldSearch
Returns a new instance of FieldSearch.
6 7 8 9 10 11 |
# File 'lib/active_scaffold/config/field_search.rb', line 6 def initialize(core_config) super @text_search = self.class.text_search @human_conditions = self.class.human_conditions @floating_footer = self.class. end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable
Instance Attribute Details
#default_params ⇒ Object
default search params default_params = => {“from”=>“test”, “to”=>“”, “opt”=>“%?%”}
73 74 75 |
# File 'lib/active_scaffold/config/field_search.rb', line 73 def default_params @default_params end |
#floating_footer ⇒ Object
whether footer should float when form is too long to fit in the screen, so footer is always available while scrolling
80 81 82 |
# File 'lib/active_scaffold/config/field_search.rb', line 80 def @floating_footer end |
#group_options ⇒ Object
add array of columns as options for group by to get aggregated listings
66 67 68 |
# File 'lib/active_scaffold/config/field_search.rb', line 66 def @group_options end |
#grouped_columns ⇒ Object
columns to display on aggregated listing
69 70 71 |
# File 'lib/active_scaffold/config/field_search.rb', line 69 def grouped_columns @grouped_columns end |
#human_conditions ⇒ Object
human conditions instead of just filtered you may show the user a humanized search condition statment
77 78 79 |
# File 'lib/active_scaffold/config/field_search.rb', line 77 def human_conditions @human_conditions end |
#link ⇒ Object
the ActionLink for this action
53 54 55 |
# File 'lib/active_scaffold/config/field_search.rb', line 53 def link @link end |
#text_search ⇒ Object
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
50 51 52 |
# File 'lib/active_scaffold/config/field_search.rb', line 50 def text_search @text_search end |
Instance Method Details
#optional_columns ⇒ Object
60 61 62 63 |
# File 'lib/active_scaffold/config/field_search.rb', line 60 def optional_columns return @optional_columns || NO_COLUMNS if frozen? @optional_columns ||= NO_COLUMNS.dup end |
#optional_columns=(optionals) ⇒ Object
rarely searched columns may be placed in a hidden subgroup
56 57 58 |
# File 'lib/active_scaffold/config/field_search.rb', line 56 def optional_columns=(optionals) @optional_columns = Array(optionals) end |