Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Creating tables with "variable" field names
Kretch Kretchmer
2/27/2008 4:59:00 AM
Hi All
I'm slowly ramping up on Ruby (Ex-PERL'y), and have the following
question:
*) I'd like to create a table , but with column names which are not
fixed. So instead of doing
<Code>
def self.up
create_table mytable do |t|
t.column :field1, :string
t.column :field2, :stringI'd like to do
</Code>
I'd like to do
<Code>
var1 = "field1"
var2 = "field2"
def self.up
create_table mytable do |t|
t.column $var1, :string
t.column $var2, :stringWhat is the correct syntax for doing that?
</Code>
Best Regards
Kretch
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Creating tables with "variable" field names
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password