I don't understand what {article: :categories}
means for the below code.
I have read the documentation, but it does not show an example like includes(z => {x: :y})
. Can somebody put this to a different form that I can understand? What exactly is x: :y
?
@articles = ArticleBase.includes(media.to_sym => { article: :categories })
In addition, if I want to add another condition to it (.includes(media.to_sym => :article)
), would the code below be alright syntax-wise?
@articles = ArticleBase.includes(media.to_sym => { article: :categories }, media.to_sym => :article)