I am trying to do something like this but I am not sure if you can do this with a inner join:
SELECT "scores".*
FROM "scores"
INNER JOIN "games" ON "games"."id" = "scores"."games_id"
WHERE
"games"."date" >= '2013-02-11 19:30:11.799227'
AND "scores".value > 350;
Thanks for the help. Also, if you know how to write a ActiveRecord / arel statement the would give the query that would be helpful as well.
My models look like this:
class Score < ActiveRecord::Base
belongs_to :game
delegates :date, to: game
end
class Game < ActiveRecord::Base
has_many :scores, dependent: :destroy
end