Commit 58e2b2cdf20055bbcc8dcf5c479cd62ef4848e1c
1 parent
b116563a
Exists in
master
and in
21 other branches
Passing tests for activerecord 3.2
Showing
3 changed files
with
3 additions
and
2 deletions
Show diff stats
Gemfile
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 | ... | ... |