Sha256: 27c1eb00013f6eda5a1e90eb2dc44f80b01a57a7f001f42c0f335b197aac6398

Contents?: true

Size: 1.21 KB

Versions: 96

Compression:

Stored size: 1.21 KB

Contents

module ActiveScaffold::Config
  
  class AdvancedSearch < Base
    
    self.crud_type = :read
    
    def initialize(core_config)
      @core = core_config

      @full_text_search = self.class.full_text_search?
      @link = self.class.link.clone
    end

    cattr_accessor :link
    @@link = ActiveScaffold::DataStructures::ActionLink.new('show_advanced_search', :label => 'Advanced Search', :type => :table, :security_method => :advanced_search_authorized?)

    attr_accessor :link
    
    cattr_writer :full_text_search
    def self.full_text_search?
      @@full_text_search
    end
    @@full_text_search = true

    attr_writer :full_text_search
    def full_text_search?
      @full_text_search
    end

    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

    def columns=(val)
      @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val)
      @columns.action = self
    end
    
    def column_objects
      @column_objects ||= @core.columns.select { |c| self.columns.include?(c.name) }
    end

  end

end

Version data entries

96 entries across 96 versions & 1 rubygems

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