Ruby on rails 轨道条件不';我无法使用嵌套调用的包含
我正在尝试这样做:Ruby on rails 轨道条件不';我无法使用嵌套调用的包含,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我正在尝试这样做: @usages = Quoteproduct.includes(:quote => :event).where(:quote => {:booked => "1"}).where(:quote => {:event => { 'end_at >= ?', @quote.event.start_at }}) 注意最后一个where结尾处的条件 但我得到: syntax error, unexpected ',', expecting tAS
@usages = Quoteproduct.includes(:quote => :event).where(:quote => {:booked => "1"}).where(:quote => {:event => { 'end_at >= ?', @quote.event.start_at }})
注意最后一个where结尾处的条件
但我得到:
syntax error, unexpected ',', expecting tASSOC ... => {:event => { 'end_at >= ?', @quote.event.start_at }})
知道我做错了什么吗
...{ 'end_at >= ?', @quote.event.start_at }...
我相信这种类型的条件需要数组
['end_at >= ?', @quote.event.start_at]
我相信这种类型的条件需要数组
['end_at >= ?', @quote.event.start_at]
用“=>”运算符替换“,”我将在“where子句”中获取:Mysql2::Error:Unknown column”events.end\u at>=?”替换“,”我将在“where子句”中获取:Mysql2::Error:Unknown column”events.end\u at>=?”