SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Decimal Errors

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Tacoma, WA
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Decimal Errors

    I am using Rails 1.1.6 and when I went to db:migrate on my schema I keep on getting this error (I'm on Windows XP SP2):
    Code:
    == AddPrice: migrating =================================
    -- add_column(:product, :price, :decimal, (:precision=>8, :scale=>2, :default=>0))
    rake aborted!
    You have a nil object when you didn't expect it!
    You might have expected an instance of Array.
    The error occured while evaluating nil. []
    I'm reading the 2nd edition of Agile Web book and this is the code I'm trying to do:

    Code:
    class AddPrice < ActiveRecord::Migration
      def self.up
        add_column :products, :price, :decimal, :precision => 8, :scale => 2, :default => 0
      end
    
      def self.down
        remove_column :products, :price
      end
    end

    When I was using my Mac I could easily just issues the rake rails:freeze:edge and It was working (of course that was back in october). But my wife broke the mac so now I'm back to sucky ol' windows. So...back to my question. Do I need to go edge on windows since I'm using the most current Rails of v 1.1.6?
    Last edited by t3projects; Dec 22, 2006 at 20:41. Reason: Editor was putting smilies in my code

  2. #2
    SitePoint Member
    Join Date
    Nov 2006
    Location
    Austin, TX
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe you need edge for this. rake freeze_edge requires you to have subversion installed and in the path. That's probably why it's not working.
    wtf242
    ProgrammingBooks.org - Programming Books Ranked by Programmers
    Turn of the Crank - My blog
    Robot Walrus - My Art Prints/Posters Blog


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •