How can we write the following statement to improve readability?
Promotion.joins(:category).where([\"lft>=? and rgt<=?\", c.lft, c.rgt]).joins(:shops).wher
Also possible to do
Promotion.joins(:category) \ .where(["lft>=? and rgt<=?", c.lft, c.rgt]) \ .joins(:shops) \ .where(:promotions_per_shops => { :shop_id => shops_id }) \ .count('id', :distinct => true)