mongoid-sphinx 0.0.7 → 0.0.9

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.
@@ -41,7 +41,7 @@ class MongoidSphinx::Context
41
41
  model_name = file.gsub(/^#{base}([\w_\/\\]+)\.rb/, '\1')
42
42
 
43
43
  next if model_name.nil?
44
- next if ::ActiveRecord::Base.send(:descendants).detect { |model|
44
+ next if defined?(::ActiveRecord::Base) && ::ActiveRecord::Base.send(:descendants).detect { |model|
45
45
  model.name == model_name.camelize
46
46
  }
47
47
 
@@ -27,7 +27,7 @@ module Mongoid
27
27
  self.search_attributes = {}
28
28
  self.index_options = options[:options] || {}
29
29
  options[:attributes].each do |attrib|
30
- self.search_attributes[attrib] = SPHINX_TYPE_MAPPING[self.fields[attrib.to_s].type.to_s] || 'str2ordinal'
30
+ self.search_attributes[attrib] = SPHINX_TYPE_MAPPING[self.fields[attrib.to_s].class.to_s] || 'str2ordinal'
31
31
  end
32
32
 
33
33
  MongoidSphinx.context.add_indexed_model self
@@ -69,7 +69,7 @@ module Mongoid
69
69
 
70
70
  puts "<classname>#{self.to_s}</classname>"
71
71
  self.search_fields.each do |key|
72
- puts "<#{key}><![CDATA[[#{document_hash[key.to_s]}]]></#{key}>"
72
+ puts "<#{key}><![CDATA[#{document_hash[key.to_s]}]]></#{key}>"
73
73
  end
74
74
  self.search_attributes.each do |key, value|
75
75
  value = case value
@@ -1,3 +1,3 @@
1
1
  module MongoidSphinx #:nodoc
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-sphinx
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Hodgson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-21 00:00:00 -05:00
18
+ date: 2011-02-22 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency