Philip Hallstrom wrote:
From a migration. I want to initialize a new column called ident
with
a string equal to prec-#{id} - where id is meant to be the id column
of the relevant row. This works:
Precinct.update_all(ident = 'prec-' || id )
I am confused about whether that bit of SQL
Marnen Laibow-Koser wrote:
To the OP: if this column is just going to be the id with a constant
prefix, then you don't need it in the DB!
It's initializing existing records in a migration. Over time the match
will not be present.
To the other point about || meaning concatenation. Thats what
On Feb 10, 2010, at 4:31 PM, Pito Salas wrote:
Marnen Laibow-Koser wrote:
To the OP: if this column is just going to be the id with a constant
prefix, then you don't need it in the DB!
It's initializing existing records in a migration. Over time the match
will not be present.
To the other
3 matches
Mail list logo