Displaying 1 result from an estimated 1 matches for "l1036".
Did you mean:
1036
2006 Nov 04
0
one to many relationship; has_one
...e
models as follows
class Content < ActiveRecord::Base
has_one :location
end
class Location < ActiveRecord::Base
belongs_to :content
end
When I attempt to access content.location I get this error
|RuntimeError: ERROR C42703 Mcolumn locations.content_id does not exist Fparse_func.c
L1036 Runknown_attribute: SELECT * FROM locations WHERE (locations.content_id = 9) LIMIT 1|
I have been able to work around this by defining the association in the
content class as
has_many :location, :finder_sql => ''SELECT * FROM locations WHERE
locations.id = #{location_id}''...