Sha256: e1e78f389b7cb39e43e708c6e296dec0191d45933e9be922992caab0b7790670

Contents?: true

Size: 538 Bytes

Versions: 4

Compression:

Stored size: 538 Bytes

Contents

module Ixtlan
  module Controllers
    module SearchQuery

      private 

      def simple_query(search_parameter)
        args = {}
        args[:limit] = params[:limit].to_i + 1 if params[:limit]
        args[:offset] = params[:offset].to_i if params[:offset]

        if login = params[search_parameter]
          if "false" == params[:fuzzy]
            args[search_parameter] = login
          else
            args[search_parameter.like] = "%" + login.to_s + "%"
          end
        end
        args
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ixtlan-0.4.0.pre3 lib/ixtlan/controllers/search_query.rb
ixtlan-0.4.0.pre2 lib/ixtlan/controllers/search_query.rb
ixtlan-0.4.0.pre lib/ixtlan/controllers/search_query.rb
ixtlan-0.3.0 lib/ixtlan/controllers/search_query.rb