-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: origin-2.2.1
-
Component/s: None
-
Environment:ruby 2.3, rails 4.2, kaminari 0.17.0, mongoid 5.1.5.
This line is giving me a really strange error message:
@borza = Borza.where(:created_at.gt => 6.months.ago ).order_by(created_at: -1).page(params[:page]).per(3)
Completed 500 Internal Server Error in 19ms
NoMethodError (undefined method `|' for 2016-04-20 07:52:18 UTC:Time):
app/controllers/borza_controller.rb:42:in `index'
Rendered vendor/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (18.1ms)
Rendered vendor/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (8.1ms)
Rendered vendor/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (5.3ms)
Rendered vendor/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (58.5ms)
The error doesn't appear if I remove pagination:
@borza = Borza.where(:created_at.gt => 6.months.ago ).order_by(created_at: -1)
The error also doesn't appear if I remove where:
@borza = Borza.all.order_by(created_at: -1).page(params[:page]).per(3)
The error seams to appear only on this collection so I am also attaching model definition.
The solution is to force origin version 2.2.0.
by
TheR
- duplicates
-
MONGOID-4357 Criteria merging broken in latest patches
- Closed