I need to write a SQL query in Rails 3.2 syntax that says:
"Give me all Submissions with missions that belong to a track where visibility_private == false
"
Track.rb
has_many :missions
attr_accessible :visibility_private
Mission.rb
belongs_to :track
has_many :submissions
Submission.rb
belongs_to :mission
My initial attempt was this, but that's definitely wrong:
Submission.joins(:mission).where(:missions => { mission.track.visibility_private == false })