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

Version Path
six-updater-web-0.24.15 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.14 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.13 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.12 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.11 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.10 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.9 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.8 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.7 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.6 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.5 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
brisk-bills-0.7.0 vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.4 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.3 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.2 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.1 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.24.0 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.23.7 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.23.6 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb
six-updater-web-0.23.5 lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb