-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump mongoid version to 6 #102
Conversation
@mauriciozaffari Looks like bundler |
This branch works on my rails 5 install, with the latest stable mongoid gem. Thank you for your good work ! However I am getting this issue #107 .. The relevancy value is always 1.0 .. If you have any idea what could be causing this, I would really appreciate. Thanks |
Can someone finish this PR with a passing build, please? I'm happy to check it out, merge, etc. |
Is this project dead? If you click the details on the build TravisCI cannot find the repo...? |
I wouldn't rely on it.. I've personally moved over to searchkick |
@sivagollapalli could you rebase your PR to current master with working CI for Mongoid 3-5 and check tests passing for Mongoid 6? If all of them are passed, we could say there is support for Mongoid 6 and close #115 |
@rtrv Sure I will rebase and update PR. |
:category => Category.new(:name => "Mobile", :description => "Reviews"), | ||
:subproducts => [Subproduct.new(:brand => "Apple", :name => "Craddle")], | ||
:info => { :summary => "Info-summary", | ||
:description => "Info-description"} | ||
@tags = ["Amazing", "Awesome", "Olé"].map { |tag| Tag.create(:name => tag, product: @product) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose, you've changed tags creation because of ActiveSupport's call
error, but if you use release Mongoid 6.0, this error doesn't appear. Revert tags initiation, it should work well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rtrv But, I am getting the same error if I run specs against MongoDB 2.6.12
and mongoid 6.0.3
. Here is the spec output
1) Mongoid::Search Serialized hash fields when the hash is populated should return the product
Failure/Error: @product = Product.create :brand => "Apple",
NoMethodError:
undefined method `call' for #<ActiveSupport::Callbacks::CallbackSequence:0x007fd6906e8e08>
# ./spec/mongoid_search_spec.rb:20:in `block (2 levels) in <top (required)>'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivagollapalli it's strange, I've just fixed it by changing Mongoid 6 version from beta to release one. Try 6.0.0
instead of 6.0.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rtrv Just checked with mongoid 6.0.0
. Still, it shows same error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivagollapalli hm, interesting. I'm checking it on my machine at this week, wanna fix 6.0 support and some minor bugs to push the gem to 0.4 by the middle of December
gem 'mongoid', '~> 3.1' | ||
else | ||
gem 'mongoid', version | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Gemfile from master and just uncomment lines 10-11, and change line 20 to '~> 6.0'
@@ -280,7 +289,8 @@ | |||
context "relevant search" do | |||
before do | |||
Mongoid::Search.relevant_search = true | |||
@imac = Product.create :name => 'apple imac' | |||
category = Category.create(name: 'New Category') | |||
@imac = Product.create :name => 'apple imac', category: category |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you added category here? If there is an error if an object without category is created, we should change validations for Product class
:category => Category.new(:name => "Vehicle") | ||
["Amazing", "First", "Car"].map { |tag| Tag.create(:name => tag, product: @product) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same about tags
expect(Variant.full_text_search("oeuvre")).to eq [variant1] | ||
expect(Variant.full_text_search("æquo")).to eq [variant2] | ||
expect(Variant.full_text_search("aequo")).to eq [variant2] | ||
["œuvre"].map { |tag| Tag.create(:name => tag, variant: variant1) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same about tags
["œuvre"].map { |tag| Tag.create(:name => tag, variant: variant1) } | ||
|
||
variant2 = Variant.create category: Category.create(name: 'New Category') | ||
["æquo"].map { |tag| Tag.create(:name => tag, variant: variant2) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same about tags
:category => Category.new(:name => "Mobile"), | ||
:subproducts => [Subproduct.new(:brand => "Apple", :name => "Craddle")], | ||
:color => :white | ||
|
||
["Amazing", "Awesome", "Olé"].map { |tag| Tag.create(:name => tag, variant: variant) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same about tags
:category => Category.new(:name => "процессоры"), | ||
:subproducts => [] | ||
|
||
["Amazing", "Awesome", "Olé"].map { |tag| Tag.create(:name => tag, product: @product) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same about tags
Replaced with #124. |
No description provided.