hello, i’d like to insert into a table with a rails function several
records and avoid a loop with Object.create. Something corresponding
to SQL instruction like it :
INSERT INTO animals(id, value)
VALUES(1, ‘dog’), (2, ‘cat’), (3, 'bird);
is it possible to do it with a create or another function? i’m looking
for it but don’t find anything about it.
hello, i’d like to insert into a table with a rails function several
records and avoid a loop with Object.create. Something corresponding
to SQL instruction like it :
INSERT INTO animals(id, value)
VALUES(1, ‘dog’), (2, ‘cat’), (3, 'bird);
is it possible to do it with a create or another function? i’m looking
for it but don’t find anything about it.
You’re going to have to do this by hand (ie connection.execute ‘…’).
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.