paco.onrails
2008-Jul-16  15:07 UTC
how to know if a column is present within a certain table
Hello there, what I need is a method to find out if a column is
present within a table giving me back a boolean value. Something like:
Mytable.columnpresent(''my_column'')
Thank you very much for your help.
Best!!
Paco Reyes
Interaction Designer
www.xentido.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
-~----------~----~----~----~------~----~------~--~---
toby privett
2008-Jul-16  15:18 UTC
Re: how to know if a column is present within a certain table
> Hello there, what I need is a method to find out if a column is > present within a table giving me back a boolean value. Something like: > > Mytable.columnpresent(''my_column'')Mytable.respond_to?(''my_column'') returns a boolean. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
paco.onrails
2008-Jul-16  15:55 UTC
Re: how to know if a column is present within a certain table
Thanks, it works fine. On Jul 16, 10:18 am, "toby privett" <tobypriv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello there, what I need is a method to find out if a column is > > present within a table giving me back a boolean value. Something like: > > > Mytable.columnpresent(''my_column'') > > Mytable.respond_to?(''my_column'') returns a boolean.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---