''joins' queries are not working on upgrading ruby from 2.0.0 to 2.3.8
I have just updated the ruby version of my project from ruby-2.0.0 to ruby-2.3.8. Now after update there seems to be a problem while using joins in rails and I am not getting why. Here is the code below.
class User < ActiveRecord::Base
has_many :items
end
class Item < ActiveRecord::Base
belongs_to :user
has_many :donors, :as => :itemable, :dependent => :destroy
end
u = User.find_by_id(15)
u.items.joins(:donors)
it is returning me a Module object like '#<#Module<:0x00000000088932f0>:0x44497e8>', which is inaccessible
but the same thing when I do in my previous ruby version before updating
it gave me the ActiveRecord:: Relation object as expected
I am not getting the problem so if anybody can suggest something.
Solution 1:[1]
Thanks, for the efforts, Its was the rails version compatiblity issue. As I upgraded my rails version to 3.2.22.5 it got fixed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Arkit Agrawal |
