Is :default allowed as an option for decimal columns? A migration: class CreateMoney < ActiveRecord::Migration def self.up create_table :money do |t| t.decimal :amount, :defaut => 0.0, :precision => 8, :scale => 2 end end def self.down drop_table :money end end Creates the following schema: create_table "money", :force => true do |t| t.decimal "amount", :precision => 8, :scale => 2 end What happened to the default, it''s gone! Bug? or do decimal columns disallow the :default option? or is it because :precision/:scale are also set? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 10, 2011, at 1:54 PM, Karl Smith wrote:> Is :default allowed as an option for decimal columns? > > A migration: > class CreateMoney < ActiveRecord::Migration > def self.up > create_table :money do |t| > t.decimal :amount, :defaut => 0.0, :precision => 8, :scale => 2 > end > end > > def self.down > drop_table :money > end > end > > Creates the following schema: > > create_table "money", :force => true do |t| > t.decimal "amount", :precision => 8, :scale => 2 > end > > What happened to the default, it''s gone! > > Bug? or do decimal columns disallow the :default option? or is it > because :precision/:scale are also set?defaut != default You''ve got a typo. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You''re missing an "l" in "default". On Thu, Feb 10, 2011 at 10:54 PM, Karl Smith <threadhead-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is :default allowed as an option for decimal columns? > > A migration: > class CreateMoney < ActiveRecord::Migration > def self.up > create_table :money do |t| > t.decimal :amount, :defaut => 0.0, :precision => 8, :scale => 2 > end > end > > def self.down > drop_table :money > end > end > > Creates the following schema: > > create_table "money", :force => true do |t| > t.decimal "amount", :precision => 8, :scale => 2 > end > > What happened to the default, it''s gone! > > Bug? or do decimal columns disallow the :default option? or is it > because :precision/:scale are also set? > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Damn. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.