First Watch fails

Support Ticket

+status
closed
+tags
 

I'm getting an application error on the "watch" function.  If I first create <card>+*watchers as a pointer card, it is fine, but otherwise it says that "Basic" doesn't have add_reference in the logs

 

What are you doing that gives you the error? Are you creating the +*watchers card by hand? The card will be created (and set to Pointer) automatically if you click on the "watch" link in a card's footer. --John Abbe


No, just clicking the "watch" thing.

 

I think I fixed it in my version, patch to follow

  --Gerry Gleason.....Thu Aug 20 12:16:16 -0700 2009


diff --git a/app/controllers/card_controller.rb b/app/controllers/card_controller.rb

index 8b19a11..5fa87c2 100644

--- a/app/controllers/card_controller.rb

+++ b/app/controllers/card_controller.rb

@@ -236,7 +236,7 @@ class CardController < ApplicationController

end

 

def watch

- watchers = Card.find_or_new( :name => @card.name + "+*watchers" )

+ watchers = Card.find_or_new( :name => @card.name + "+*watchers", :type => 'Pointer' )

watchers.add_reference User.current_user.card.name

flash[:notice] = "You are now watching #{card.name}"

request.xhr? ? render(:inline=>%{<%= get_slot.watch_link %>}) : view

  --Gerry Gleason.....Thu Aug 20 12:17:20 -0700 2009


Ah, looks like a migration issue. *watchers+*rform should have been created with the upgrade, with its type set to Pointer. That solves this without mentioning type explicitly in the code.

  --John Abbe.....Thu Aug 20 12:18:57 -0700 2009


I thought it may have been migration related. When I was updating, I was thinking about which db the db:migrate changes. Is it all of them (test, production, development), or only part? I probably ran it only against development, but I'm not sure how this works.

  --Gerry Gleason.....Thu Aug 20 12:46:08 -0700 2009


yeah it only runs against one environment at a time, defaults to development. you can specify eg. env RAILS_ENV=production rake db:migrate

Thanks for the patch! it should only be necessary in cases where the migration didn't work for some reason, but awesome to have that fixed.

  --Lewis Hoffman (Not signed in).....Thu Aug 20 16:11:03 -0700 2009