My DB column is name "3gp", but the below is invalid syntax. How can i express this in ruby? class CreateVideos < ActiveRecord::Migration def self.up create_table :videos do |t| t.column :x, :integer t.column :y, :integer t.column :max_time, :integer t.column :max_file, :integer t.column :mp4, :integer t.column :3gp, :integer //how do this? end end def self.down drop_table :videos end end --~--~---------~--~----~------------~-------~--~----~ 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 Aug 20, 2007, at 8:19 PM, eggie5 wrote:> t.column :3gp, :integer //how do this?I know it''s not the most natural sounding thing in the world but is it heresy in Rails to just name it something like :video3gp or :format3gp instead of :3gp? - Cliff --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I would use your later suggestion as rails will attempt to create accessor / mutator methods for this column, and method names can not start with a number. Cliff Pruitt wrote:> On Aug 20, 2007, at 8:19 PM, eggie5 wrote: > > >> t.column :3gp, :integer //how do this? >> > > I know it''s not the most natural sounding thing in the world but is > it heresy in Rails to just name it something like :video3gp > or :format3gp instead of :3gp? > > - Cliff > > > > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> class CreateVideos < ActiveRecord::Migration > def self.up > create_table :videos do |t| > t.column :x, :integer > t.column :y, :integer > t.column :max_time, :integer > t.column :max_file, :integer > t.column :mp4, :integer > t.column :3gp, :integer //how do this? > end > endt.column ''3gp'', :integer or perhaps you could use a different name -- 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 -~----------~----~----~----~------~----~------~--~---