I need to query only Realties
where user id confirmed.
I am using "devise" gem for authentication, and my query looks like this:
@search = Realty.includes(:user).where("users.confirmed_at != ?", nil)
As result I get => []
, but there are many Realties
records where user.confirmed? => true
. I double checked it from the console.
The association structure looks like this:
class Realty
belongs_to :user
.....
class User
has_many :realties
.....
Please help me or tell where I make an mistake ?? Thank you.