Rails conditions don't work for me with includes with nested calls -


i'm trying this:

@usages = quoteproduct.includes(:quote => :event).where(:quote => {:booked => "1"}).where(:quote => {:event => { 'end_at >= ?', @quote.event.start_at }}) 

notice condition @ end of last where.

but get:

syntax error, unexpected ',', expecting tassoc ... => {:event => { 'end_at >= ?', @quote.event.start_at }}) 

any idea i'm doing wrong?

...{ 'end_at >= ?', @quote.event.start_at }... 

i believe style of condition requires array.

['end_at >= ?', @quote.event.start_at] 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -