Sha256: 9eea1672fe9fec443071569a7000605b5b4a42bdbf71363dc0e98ed7c6e70ba2

Contents?: true

Size: 672 Bytes

Versions: 14

Compression:

Stored size: 672 Bytes

Contents

# encoding: utf-8

module User
  class WithoutFulltext < ActiveRecord::Base

    self.table_name = 'users_without_fulltext'

    search_syntax do

      search_by :text do |scope, text|
        scope.where_like([:name, :email, :city] => text)
      end

      search_by :city do |scope, city|
        scope.scoped(:conditions => { :city => city })
      end

      search_by :email do |scope, email|
        scope.scoped(:conditions => { :email => email })
      end

    end

    search_syntax do # multiple search_syntax directives are allowed

      search_by :role do |scope, role|
        scope.scoped(:conditions => { :role => role })
      end

    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dusen-0.5.1 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.5 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.11 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.10 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.9 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.8 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.6 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.5 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.4 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.3 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.2 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.1 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.4.0 spec/shared/app_root/app/models/user/without_fulltext.rb
dusen-0.3.0 spec/shared/app_root/app/models/user/without_fulltext.rb