Ruby On Rails / ID question

P

Peter Kellner

I've got an outer join using postgres and am using the insert and update
rules to update the underlying tables. The problem I am having is rails
keeps wanting a column ID. I have d.id but no id by itself. I even
tried creating a view of a view, but it was not fooled. Here are my
views.

CREATE OR REPLACE VIEW englishdataentries_primitive AS
SELECT
d.id,a.attribute_id,a.attribute_name_value,a.attribute_type,d.thedata
from datas d right outer join attribute_names a on d.attribute_id =
a.attribute_id
WHERE a.language_id IN (select id from LANGUAGES where
language_description='english') and a.base_table_id = 1 ;

CREATE OR REPLACE VIEW englishdataentries AS
SELECT id as
id,attribute_id,attribute_name_value,attribute_type,thedata
FROM englishdataentries_primitive;


Any ideas how I can get it not to say "Couldn't find Englishdataentry
without an ID". I'm not updating the view anyway so the error is
killing me and I would just assume not have it thrown.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,947
Members
47,498
Latest member
log5Sshell/alfa5

Latest Threads

Top