Forum: Ruby on Rails Rails coding question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John (Guest)
on 2006-03-05 03:00
Hi,

If we have two tables like:

create table students {
  name text,
  id integer
}

create table evaluations {
  comments text
} inherits (a)

is it possible to transfer a row from table evaluations to table
students without explicitly typing all the column names?

For example, if we have a row from table evaluations called eval_row,
and a row from students called stud_row, can we do...

for column in Student.columns
  ???? = eval_row.send(column.name)
end

What would go in the ????

Thanks,
John
This topic is locked and can not be replied to.