You are totally right, this should fix it:

https://github.com/Hobo/hobo/commit/9ee13c6ba64e3f440e3eadbe2388d3938fbe92b3

Regards,
Ignacio

El 18/01/14 12:56, Stefan Haslinger escribió:
> Hi Ignacio, 
> 
> sorry to bother you again, when you fixed the default ordering, I
> believe you were not specific enough with the ordering.
> I have products, which have ordered property_groups which have ordered
> properties themselves.
> 
> A product show view now fails with
> 
>     Mysql2::Error: Column 'position' in order clause is ambiguous:
>     SELECT  1 AS one FROM `properties` INNER JOIN `property_groups` ON
>     `properties`.`property_group_id` = `property_groups`.`id` WHERE
>     `property_groups`.`product_id` = 1826  ORDER BY *position* ASC LIMIT 1
> 
> 
> when I introduce my old fix 
> 
>     default_scope { order("properties.position ASC") } 
> 
> it still complains because:
> 
>     Mysql2::Error: Column 'position' in order clause is ambiguous:
>     SELECT  1 AS one FROM `properties` INNER JOIN `property_groups` ON
>     `properties`.`property_group_id` = `property_groups`.`id` WHERE
>     `property_groups`.`product_id` = 1826  ORDER BY *properties.position
>     ASC*, position ASC LIMIT 1
> 
> 
> Deactivating acts_as_list resolves the dump, but removes the view as
> well, of course.
> So where you introduced the ordering, it should not only be ordered by
> position, but by tablename.position or something close to that, I'm
> quite sure.
> 
> Warm regards,
> Stefan
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/hobousers.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to