Hey folks - thanks in advance for any help. I''m in the process of upgrading from 1.2.6 to 2.0.2. Everything''s working great in 1.2.6, got rid of all deprecation messages, etc. But I''ve been banging my head against a wall with this problem and am all Googled out. I can''t seem to access any information through ANY of my belongs_to: relationships. For example: In my model I''ve got class Row which belongs_to :Entity So in console I can look at a Row object: #<Row:0x3278dd4 @attributes={"_clean_name"=>"Set 8A", "rating"=>nil, "created_on"=>"2006-12-19 18:09:55", "name"=>"<strong>Set 8A</ strong>", "entity_id"=>"5", "guid"=>"ZAQ-84935", "creator_id"=>"2", "id"=>"769"}> If I say @row.Entity in my 1.2.6 console I get: #<Entity:0x3249d2c @attributes={"rating_votes"=>"0", "uses_images"=>"1", "created_on"=>"2006-10-27 00:00:00", "name"=>"Anker stones", "singular"=>nil, "creator_id"=>"1", "uses_table"=>"0", "id"=>"5", "description"=>"blah blah", "entity_type_id"=>"2", "image_id"=>"7242", "name_rule"=>"<strong>{Set Number}</strong>", "rows_count"=>"2", "base_id"=>nil, "example_row_id"=>"770"}> However, if I say @row.Entity in my 2.0.2 console I get ... wait for it ... nil. This happens any time I try to access a table relationship like that. Has anyone else seen anything like this? Have any suggestions? thanks much! Jon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try saying belongs_to :entity instead. On Jan 25, 2008 11:26 AM, Jon <Stashmatic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hey folks - thanks in advance for any help. I''m in the process of > upgrading from 1.2.6 to 2.0.2. Everything''s working great in 1.2.6, > got rid of all deprecation messages, etc. But I''ve been banging my > head against a wall with this problem and am all Googled out. > > I can''t seem to access any information through ANY of my belongs_to: > relationships. For example: > > In my model I''ve got class Row which belongs_to :Entity > > So in console I can look at a Row object: > #<Row:0x3278dd4 @attributes={"_clean_name"=>"Set 8A", "rating"=>nil, > "created_on"=>"2006-12-19 18:09:55", "name"=>"<strong>Set 8A</ > strong>", "entity_id"=>"5", "guid"=>"ZAQ-84935", "creator_id"=>"2", > "id"=>"769"}> > > If I say @row.Entity in my 1.2.6 console I get: > #<Entity:0x3249d2c @attributes={"rating_votes"=>"0", > "uses_images"=>"1", "created_on"=>"2006-10-27 00:00:00", > "name"=>"Anker stones", "singular"=>nil, "creator_id"=>"1", > "uses_table"=>"0", "id"=>"5", "description"=>"blah blah", > "entity_type_id"=>"2", "image_id"=>"7242", "name_rule"=>"<strong>{Set > Number}</strong>", "rows_count"=>"2", "base_id"=>nil, > "example_row_id"=>"770"}> > > However, if I say @row.Entity in my 2.0.2 console I get ... wait for > it ... > nil. > > This happens any time I try to access a table relationship like that. > Has anyone else seen anything like this? Have any suggestions? > > thanks much! > Jon > > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Wow - that did it. Many thanks, Ryan. Now you willing to come over and methodically lowercase every reference to those models in my app? No? J On Jan 24, 8:36 pm, "Ryan Bigg" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try saying belongs_to :entity instead. > > On Jan 25, 2008 11:26 AM, Jon <Stashma...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hey folks - thanks in advance for any help. I''m in the process of > > upgrading from 1.2.6 to 2.0.2. Everything''s working great in 1.2.6, > > got rid of all deprecation messages, etc. But I''ve been banging my > > head against a wall with this problem and am all Googled out. > > > I can''t seem to access any information through ANY of my belongs_to: > > relationships. For example: > > > In my model I''ve got class Row which belongs_to :Entity > > > So in console I can look at a Row object: > > #<Row:0x3278dd4 @attributes={"_clean_name"=>"Set 8A", "rating"=>nil, > > "created_on"=>"2006-12-19 18:09:55", "name"=>"<strong>Set 8A</ > > strong>", "entity_id"=>"5", "guid"=>"ZAQ-84935", "creator_id"=>"2", > > "id"=>"769"}> > > > If I say @row.Entity in my 1.2.6 console I get: > > #<Entity:0x3249d2c @attributes={"rating_votes"=>"0", > > "uses_images"=>"1", "created_on"=>"2006-10-27 00:00:00", > > "name"=>"Anker stones", "singular"=>nil, "creator_id"=>"1", > > "uses_table"=>"0", "id"=>"5", "description"=>"blah blah", > > "entity_type_id"=>"2", "image_id"=>"7242", "name_rule"=>"<strong>{Set > > Number}</strong>", "rows_count"=>"2", "base_id"=>nil, > > "example_row_id"=>"770"}> > > > However, if I say @row.Entity in my 2.0.2 console I get ... wait for > > it ... > > nil. > > > This happens any time I try to access a table relationship like that. > > Has anyone else seen anything like this? Have any suggestions? > > > thanks much! > > Jon > > -- > Ryan Bigghttp://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jon wrote:> Wow - that did it. Many thanks, Ryan. Now you willing to come over > and methodically lowercase every reference to those models in my app? > No? > > JAnd now you will discover the joy of NetBeans/TextMate. -- 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 -~----------~----~----~----~------~----~------~--~---