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

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -