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.

Reply via email to