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 :P thanxs! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 8 Dec 2008, at 18:33, jeljer te Wies wrote:> > 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 :P >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> thanxs! > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
:( 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 :( Ok wel then I will have to do something with my database design So that I would be possible.... But it won''t be pritty either :( Thanxs allot though for the reply ! I really apreciate it Jeljer Frederick Cheung wrote:> On 8 Dec 2008, at 18:33, jeljer te Wies wrote: > >> exists ? in a table of course :P >> > 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-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 8 Dec 2008, at 21:28, jeljer te Wies wrote:> > > :( 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 :( >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> Ok wel then I will have to do something with my database design > So that I would be possible.... But it won''t be pritty either :( > > Thanxs allot though for the reply ! > I really apreciate it > > Jeljer > > > Frederick Cheung wrote: >> On 8 Dec 2008, at 18:33, jeljer te Wies wrote: >> >>> exists ? in a table of course :P >>> >> 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 > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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! :) On Dec 8, 10:36 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 8 Dec 2008, at 21:28, jeljer te Wies wrote: > > > > > :( 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 :( > > 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 > > > Ok wel then I will have to do something with my database design > > So that I would be possible.... But it won''t be pritty either :( > > > Thanxs allot though for the reply ! > > I really apreciate it > > > Jeljer > > > Frederick Cheung wrote: > >> On 8 Dec 2008, at 18:33, jeljer te Wies wrote: > > >>> exists ? in a table of course :P > > >> 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 > > > -- > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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:> 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! :) > > On Dec 8, 10:36 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---