I have been breaking my head trying to do something simple but i can't. Im using rails version 4.2.6
The thing is that i have this three models with the next values.
Bet
match_id
#more values..
Match
#values...
MatchResult
match_id (One to one relation with match, that means i have a has_one...)
#more values...
what im trying to do is something like this
Bet.where(:match => {:match_results => nil})
Also tried using Bet.joins() method but its not working, i saw and tried also something like this post, but i could not figure out a way. Rails Nested Joins Activerecord with conditions
So basically i want to bring all Bets which have a Match which does not have any Match_result.match_id. If i get Match.first.match_result it does work and bring me one. Is there any way to bring them?
Thanks!