[Rails] Re: Why does this output to the console?

2009-07-17 Thread JannaB
so to use your statement, I should put the following in my Associate model? belongs_to :watching_channel, :class_name = Channel, :foreign_key = watching_channel_id -Janna B On Jul 17, 1:09 am, Rodrigo Dominguez rails-mailing-l...@andreas- s.net wrote: Janna Brossard wrote: yes,

[Rails] Re: Why does this output to the console?

2009-07-17 Thread Nicholas Henry
That should work. Cheers, Nicholas On Jul 17, 8:47 am, JannaB mistressja...@hotmail.com wrote: so to use your statement, I should put the following in my Associate model? belongs_to :watching_channel, :class_name = Channel, :foreign_key = watching_channel_id -Janna B On Jul 17, 1:09 

[Rails] Re: Why does this output to the console?

2009-07-16 Thread Nicholas Henry
I'm not sure, but you probably should rewrite that: if @channel.nil? !current_associate.watching_channel_id.nil? current_associate.watching_channel_id 0 better still why are you checking if watching_channel_id is gt 0? Is watching_channel_id a foreign key for an association for watching

[Rails] Re: Why does this output to the console?

2009-07-16 Thread JannaB
yes, current_associate.watching_channel_id IS a foreign key to channel.id. But I have not specified it as such in the associate model or the channel model (not sure how -- or if I even need to!) -Janna On Jul 16, 8:56 pm, Nicholas Henry nicholas.he...@gmail.com wrote: I'm not sure, but you

[Rails] Re: Why does this output to the console?

2009-07-16 Thread Rodrigo Dominguez
Janna Brossard wrote: yes, current_associate.watching_channel_id IS a foreign key to channel.id. But I have not specified it as such in the associate model or the channel model (not sure how -- or if I even need to!) -Janna if the class name is WatchingChannel, the it will work belongs_to