Re: [Rails] Select with an alias does not show alias column in "having".

2014-09-03 Thread Christian Kruse
Hi, At Wed, 3 Sep 2014 10:38:13 -0700 (PDT), ruby user wrote: > When i run this query to get Images with tags that are named both > bamboo in and Green i get an error that says the alias table is not > present. What am I doing wrong? > > Image.joins(:tags).select("images.*, count(tags.id) as > '

[Rails] Select with an alias does not show alias column in "having".

2014-09-03 Thread ruby user
The Model Image has many Tags When i run this query to get Images with tags that are named both bamboo in and Green i get an error that says the alias table is not present. What am I doing wrong? Image.joins(:tags).select("images.*, count(tags.id) as 'tags_count'").where(tags:{name:["bamboo