algoliasearch-rails 1.4.1 → 1.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7c04861a87809fcc0e5b1f6a3195b38e62e5634
4
- data.tar.gz: 1f354ed3067a4c438deef7d1355eaeb98c75edd1
3
+ metadata.gz: a1a8a98b4773a8017d1999a6677431a0e62986bb
4
+ data.tar.gz: 9d44b24a5e961e77f2d9d3e410062a7fefb586bd
5
5
  SHA512:
6
- metadata.gz: 4329b3f1440d9dbb810da2225dbf04de248cbb771cdddfd508a44bf038b643ee6ca76fafd3a3282086dda476073dca63478522ed9141478579aaae6154f70618
7
- data.tar.gz: 56b9c819f5e5d7b7cd79c664adecc2f8b770b19c45113682a0193d666090712c755e3ee60350f22841ec8c38da331e3b05af102fe5835ba923d3471d28ac8785
6
+ metadata.gz: 9f675a30e07369d2dcbfe090a18b2b485f395b29078b86964a04e8d474a299b7802e84290afb98089e966f508d94f75fe1ede858a20b07585587b6ea18266188
7
+ data.tar.gz: 92e0aa9140655da8f9e082ea6c870f9a6b6d5f1705a40c844e8424f4b9b25718e95dca963d1f47c240fb154fb3a8f43f1275bdb971e468a8068ebb20faf0ed33
data/.travis.yml CHANGED
@@ -5,7 +5,7 @@ branches:
5
5
  rvm:
6
6
  - 2.0.0
7
7
  - 1.9.3
8
- - rbx-19mode
8
+ - rbx
9
9
  env:
10
10
  global:
11
11
  - secure: wRDLGbg+GS7Eo6KhjyAA6YNm6rFVo8j53b0oEZLBkJ2VzvLsKMnpEfopzc0W2wttgVwgkX8C/9adbd/BPsEYbpO+uJFt5DX3A2HVVXCZ2jP0TgLj2m4dOA4ohroYDcdeB0fuZM7a7hvFNswd9vSRLmes6vLQ0GcFTSz1rWQLf6U=
data/ChangeLog CHANGED
@@ -1,5 +1,9 @@
1
1
  CHANGELOG
2
2
 
3
+ 2013-11-25 1.4.2
4
+
5
+ * fixed const_get calls with ruby 1.9.3
6
+
3
7
  2013-11-25 1.4.1
4
8
 
5
9
  * ability to specify a block associated to an attribute as value
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.1
1
+ 1.4.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "algoliasearch-rails"
8
- s.version = "1.4.1"
8
+ s.version = "1.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Algolia"]
@@ -160,7 +160,7 @@ module AlgoliaSearch
160
160
  ensure_init
161
161
  json = @index.search(q, Hash[settings.map { |k,v| [k.to_s, v.to_s] }])
162
162
  results = json['hits'].map do |hit|
163
- o = Object.const_get(@options[:type]).find(hit['objectID'])
163
+ o = full_const_get(@options[:type].to_s).find(hit['objectID'])
164
164
  o.highlight_result = hit['_highlightResult']
165
165
  o
166
166
  end
@@ -205,6 +205,18 @@ module AlgoliaSearch
205
205
  false
206
206
  end
207
207
 
208
+ def full_const_get(name)
209
+ list = name.split('::')
210
+ list.shift if list.first.blank?
211
+ obj = self
212
+ list.each do |x|
213
+ # This is required because const_get tries to look for constants in the
214
+ # ancestor chain, but we only want constants that are HERE
215
+ obj = obj.const_defined?(x) ? obj.const_get(x) : obj.const_missing(x)
216
+ end
217
+ obj
218
+ end
219
+
208
220
  end
209
221
 
210
222
  # these are the instance methods included
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia