mwmitchell-rsolr-ext 0.7.6 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,10 +34,6 @@ module RSolr::Ext::Findable
34
34
  def find(*args, &blk)
35
35
  mode, solr_params, opts = extract_find_opts!(*args)
36
36
 
37
- unless solr_params.respond_to?(:each_pair)
38
- solr_params = {:q=>solr_params}
39
- end
40
-
41
37
  opts[:include_response] = false unless opts.key?(:include_response)
42
38
 
43
39
  solr_params[:rows] = 1 if mode == :first
@@ -74,7 +70,7 @@ module RSolr::Ext::Findable
74
70
  solr_params = id
75
71
  else
76
72
  solr_params[:phrases] ||= {}
77
- solr_params[:phrases][:id] = id
73
+ solr_params[:phrases][:id] = id.to_s
78
74
  end
79
75
  self.find(:first, solr_params, opts, &blk)
80
76
  end
@@ -83,13 +79,15 @@ module RSolr::Ext::Findable
83
79
 
84
80
  def extract_find_opts!(*args)
85
81
  mode = :all
86
- # extract the mode (:all or :first)
87
82
  valid_modes = [:all, :first]
88
83
  if args[0].is_a?(Symbol)
89
84
  mode = valid_modes.include?(args[0]) ? args.shift : raise("Invalid find mode; should be :first or :all")
90
85
  end
91
86
  # extract solr params
92
- solr_params = args.shift || {}
87
+ solr_params = args.shift
88
+ unless solr_params.respond_to?(:each_pair)
89
+ solr_params = {:q=>solr_params.to_s}
90
+ end
93
91
  # extract options
94
92
  opts = args.shift || {}
95
93
  [mode, solr_params, opts]
data/lib/rsolr-ext.rb CHANGED
@@ -23,7 +23,7 @@ module RSolr
23
23
 
24
24
  module Ext
25
25
 
26
- VERSION = '0.7.6'
26
+ VERSION = '0.7.7'
27
27
 
28
28
  autoload :Request, 'rsolr-ext/request.rb'
29
29
  autoload :Response, 'rsolr-ext/response.rb'
data/rsolr-ext.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rsolr-ext"
3
- s.version = "0.7.6"
3
+ s.version = "0.7.7"
4
4
  s.date = "2009-05-04"
5
5
  s.summary = "An extension lib for RSolr"
6
6
  s.email = "goodieboy@gmail.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mwmitchell-rsolr-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Mitchell