Displaying 1 result from an estimated 1 matches for "outer_part".
Did you mean:
after_part
2006 Feb 28
1
Wrong id after join!
...s
are wrong! It is setting the Entity id to the value from Postcode id!
The Code
--------
entities = Entity.find(:all,
:conditions => [...omited...],
:joins => "as e inner join postcodes as pc on
substring_index(e.postcode,'' '', 1) = pc.outer_part " )
Produces the folowing SQL
-------------------------
SELECT * FROM entities as e inner join postcodes as pc on
substring_index(e.postcode,'' '', 1) = pc.outer_part WHERE (categories_id
= 4 and pc.metres_x >= 367400.0 and pc.metres_x <= 399400.0 and
pc.metres_y >...