问题:是否可以在散列条件下测试连接表的属性是否大于/小于值
一个例子:测试演员年龄是否大于ageVariable:
是否可以写而不是ARRAY CONDITION:
ageVariable = 36<br> Movie.includes(:actors).where("actors.age > ?", ageVariable)
哈希条件类似于:
ageVariable = 36 Movie.includes(:actors).where(:actors => { :age => COMPARE_LOGIC }) # Where COMPARE_LOGIC is something like: (:age > ageVariable)