Sha256: 3bffe7266b95cdec1a6e1835b33427ede7a3e4bd386622e135c056b8d5147ed4
Contents?: true
Size: 1.46 KB
Versions: 99
Compression:
Stored size: 1.46 KB
Contents
module ActiveScaffold::Config class Search < Base self.crud_type = :read 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 # global level configuration # -------------------------- # the ActionLink for this action cattr_accessor :link @@link = ActiveScaffold::DataStructures::ActionLink.new('show_search', :label => :search, :type => :table, :security_method => :search_authorized?) cattr_writer :full_text_search def self.full_text_search? @@full_text_search end @@full_text_search = true # instance-level configuration # ---------------------------- # provides access to the list of columns specifically meant for the Search to use 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 def columns=(val) @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val) @columns.action = self end attr_writer :full_text_search def full_text_search? @full_text_search end # the ActionLink for this action attr_accessor :link end end
Version data entries
99 entries across 99 versions & 3 rubygems