While it is a has_one association, the table name is addresses, and ActiveRecord won't give the table an alias unless it's referenced more than once, hence why it's plural (the table name) instead of singular (the association name).
Good to know you've got it figured out. Cheers -- Pat On 31/05/2010, at 6:18 AM, badnaam wrote: > Thanks Pat. > > I tried this.. > > has addressible(:id), :as => :addessible_id > > since it wont take "id" and it still throws the same error. > > However what work is this..changing address to adresses. But this > should not be the case since the model has_one address. > has 'RADIANS(addresses.lat)', :as => :latitude, :type > => :float > has 'RADIANS(addresses.lng)',:as => :longitude, :type > => :float > > > On May 29, 10:58 pm, Pat Allan <[email protected]> wrote: >> You'll need to make sure the join is included... try adding the following: >> has addressible.id, :as => :addessible_id >> >> This forces the join. >> >> Cheers >> >> -- >> Pat >> >> On 30/05/2010, at 9:29 AM, badnaam wrote: >> >>> My Store model is like.. >> >>> has_one :address, :as => :addressible, :dependent => :destroy >> >>> The Address model has lat and lng columns as floats >> >>> If I do this in my define index.. >> >>> has 'RADIANS(addressible.lat)', :as => :latitude, :type => :float >>> has 'RADIANS(addressible.lng)', :as => :longitude, :type >>> => :float >> >>> I get this errror >> >>> sql_range_query: Unknown column 'addressible.lat' in 'field list' >> >>> What am I doing wrong here? >> >>> Thanks >> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Thinking Sphinx" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group >>> athttp://groups.google.com/group/thinking-sphinx?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en. > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
