add a column "on the fly"

Hi people,

Does anybody know if it is possible to create columns on the fly..
so wihout a migration.

I would like to do this so that my customers can create multiple
languages whitout me generating that language for them.

ohw an second question: could I then check if a particularly column
exists ? in a table of course :stuck_out_tongue:

thanxs!

Hi people,

Does anybody know if it is possible to create columns on the fly..
so wihout a migration.

I would like to do this so that my customers can create multiple
languages whitout me generating that language for them.

ohw an second question: could I then check if a particularly column
exists ? in a table of course :stuck_out_tongue:

Well you can of course execute arbitrary sql
(ActiveRecord::Base.connection.execute), which could add a column (you
will run into the slight issue that you will need to get all of your
mongrels/mod_rails instances etc... to call
SomeTable.reset_column_information). This sounds like a horrifically
bad idea though

Fred

:frowning: If you put it like that yes !..
Such a shame ! Beceaus it would have been verry cool
To add languages on the fly as a customer :frowning:

I've absolutely no idea what you're doing or trying to do, but I doubt
that adding columns on the fly is the only way to accomplish what you
want.

Fred

Why can't you make an additional model "language" and another model of
"message", then you only need:

language.rb: has_many => :messages
message.rb: belongs_to => :language

Then you might have infinite number of languages with infinite number
of messages ;)))

Good luck! :slight_smile:

Yes thanxs !.. I have thought of the same solution.

I now have the following.. :

Languages:
      -id
      -name

menus
     -id
     -title
     -languages id

This is a much better solution !! .. I really don't know why haven't
thought of it
sooner.

Thanxs for al the replays guys!.

gr jeljer

Paweł K wrote: