Commit 58e2b2cdf20055bbcc8dcf5c479cd62ef4848e1c

Authored by Andrew Kane
1 parent b116563a

Passing tests for activerecord 3.2

Gemfile
... ... @@ -5,3 +5,4 @@ gemspec
5 5  
6 6 # gem "mongoid", github: "mongoid/mongoid"
7 7 # gem "mongoid", "~> 3.1.0"
  8 +# gem "activerecord", "~> 3.2.0"
... ...
test/similar_test.rb
... ... @@ -4,7 +4,7 @@ class TestSimilar < Minitest::Unit::TestCase
4 4  
5 5 def test_fields
6 6 store_names ["1% Organic Milk", "2% Organic Milk", "Popcorn"]
7   - assert_equal ["2% Organic Milk"], Product.find_by(name: "1% Organic Milk").similar(fields: ["name"]).map(&:name)
  7 + assert_equal ["2% Organic Milk"], Product.where(name: "1% Organic Milk").first.similar(fields: ["name"]).map(&:name)
8 8 end
9 9  
10 10 end
... ...
test/test_helper.rb
... ... @@ -66,7 +66,7 @@ class Product < ActiveRecord::Base
66 66 attr_accessor :conversions, :user_ids
67 67  
68 68 def search_data
69   - as_json.merge conversions: conversions, user_ids: user_ids
  69 + as_json(root: false).merge conversions: conversions, user_ids: user_ids
70 70 end
71 71 end
72 72  
... ...