ruby on rails - ActiveRecord join with new 1.9 hash syntax -


I have an AR query that looks like this

  user.books.joins (: Writers). Where (: Author = & gt; {: id = & gt; [1,2,3]},: title = & gt; 'blah')   

This is just an example But notice when I specify conditions on a composite table, I am using pre-1.9 hash syntax. : Author = & gt; {: Id = & gt; [1,2,3]}

Is it a way to do the same query with 1.9 hash syntax?

It is very readable as it is and the 1.9 syntax will probably reduce it. But I am still curious if this is possible and how it will look.

This completely new syntax:

  user.book. Junks (: Author). Where (authors: {id: [1,2,3]}, title: 'blah')    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -