'joins' queries are not working on upgrading ruby from 2.0.0 to 2.3.8

75 Views Asked by At

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.

1

There are 1 best solutions below

0
Arkit Agrawal On

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.