Sha256: b706ad4fcc36fed371aa9993d6ca3198dd4daf3215d48d38a6d6b38fbaee8b10

Contents?: true

Size: 389 Bytes

Versions: 1

Compression:

Stored size: 389 Bytes

Contents

module Pollyanna
  module Searchable

    def self.included(klass)
      klass.class_eval do
        before_save :set_search_text
        named_scope :search, lambda { |*args| query, options = args; Search.new(query, table_name).scope_options(options) }
      end
    end
    
    def set_search_text
      self.search_text = search_text if respond_to?(:"search_text=")
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pollyanna-1.0.4 lib/pollyanna/searchable.rb