I am storing a shape object in a session, and somewhere I picked up that to make sure I can restore the full glory of Shape, I needed this line in ApplicationController model :Shape So, of course, I also have a file /app/models/shape.rb All was working well, but then I decided I''d rather name the model MyShape. So, I - edited the filename to "my_shape.rb" - edited the shape.rb file to "class MyShape < AR" - edited "model :MyShape" Now I get a "missing model error." Dude, it''s right there, I can see it. However, I can''t find where I picked up that I needed to add the ''model'' line. So, I can''t remember all the details of why it''s there, what the rules are, what I am forgetting, etc. Trying to figure out how to google for that one is a futile exercise. Attempting to search various online docs for the Rails API are also fruitless. Dazed, confused, and lost. And it was going so well for a while... -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Did you restart the server? -Bill On Nov 4, 2007, at 12:42 PM, Greg Willits wrote:> > I am storing a shape object in a session, and somewhere I picked up > that to make sure I can restore the full glory of Shape, I needed > this line in ApplicationController > > model :Shape > > So, of course, I also have a file /app/models/shape.rb > > All was working well, but then I decided I''d rather name the model > MyShape. > > So, I > - edited the filename to "my_shape.rb" > - edited the shape.rb file to "class MyShape < AR" > - edited "model :MyShape" > > Now I get a "missing model error." > > Dude, it''s right there, I can see it. > > However, I can''t find where I picked up that I needed to add the > ''model'' line. So, I can''t remember all the details of why it''s there, > what the rules are, what I am forgetting, etc. > > Trying to figure out how to google for that one is a futile exercise. > > Attempting to search various online docs for the Rails API are also > fruitless. > > Dazed, confused, and lost. And it was going so well for a while... > > -- gw > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 4 Nov 2007, at 20:42, Greg Willits wrote:> > I am storing a shape object in a session, and somewhere I picked up > that to make sure I can restore the full glory of Shape, I needed > this line in ApplicationController > > model :Shape > > So, of course, I also have a file /app/models/shape.rb > > All was working well, but then I decided I''d rather name the model > MyShape. > > So, I > - edited the filename to "my_shape.rb" > - edited the shape.rb file to "class MyShape < AR" > - edited "model :MyShape" > > Now I get a "missing model error." > > Dude, it''s right there, I can see it.Have you tried clearing out your sessions. I''m guessing that it''s trying to restore your session, and since your session was created before you made the change it contains an instance of Shape, not MyShape.> > > However, I can''t find where I picked up that I needed to add the > ''model'' line. So, I can''t remember all the details of why it''s there, > what the rules are, what I am forgetting, etc. >I thought that was dead. Fred> Trying to figure out how to google for that one is a futile exercise. > > Attempting to search various online docs for the Rails API are also > fruitless. > > Dazed, confused, and lost. And it was going so well for a while... > > -- gw > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ahh yes, I bet Fredrick is correct on the fact that it is trying to instantiate the incorrect class from a stale model and on the second point that it is no longer needed. -Bill On Nov 4, 2007, at 12:47 PM, Frederick Cheung wrote:> > > On 4 Nov 2007, at 20:42, Greg Willits wrote: > >> >> I am storing a shape object in a session, and somewhere I picked up >> that to make sure I can restore the full glory of Shape, I needed >> this line in ApplicationController >> >> model :Shape >> >> So, of course, I also have a file /app/models/shape.rb >> >> All was working well, but then I decided I''d rather name the model >> MyShape. >> >> So, I >> - edited the filename to "my_shape.rb" >> - edited the shape.rb file to "class MyShape < AR" >> - edited "model :MyShape" >> >> Now I get a "missing model error." >> >> Dude, it''s right there, I can see it. > > Have you tried clearing out your sessions. I''m guessing that it''s > trying to restore your session, and since your session was created > before you made the change it contains an instance of Shape, not > MyShape. >> >> >> However, I can''t find where I picked up that I needed to add the >> ''model'' line. So, I can''t remember all the details of why it''s there, >> what the rules are, what I am forgetting, etc. >> > I thought that was dead. > > Fred >> Trying to figure out how to google for that one is a futile exercise. >> >> Attempting to search various online docs for the Rails API are also >> fruitless. >> >> Dazed, confused, and lost. And it was going so well for a while... >> >> -- gw >> >> >> >>> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
*stale session. (what I get for doing 3 things at once) -Bill On Nov 4, 2007, at 12:52 PM, William Pratt wrote:> > Ahh yes, I bet Fredrick is correct on the fact that it is trying to > instantiate the incorrect class from a stale model and on the second > point that it is no longer needed. > > -Bill > On Nov 4, 2007, at 12:47 PM, Frederick Cheung wrote: > >> >> >> On 4 Nov 2007, at 20:42, Greg Willits wrote: >> >>> >>> I am storing a shape object in a session, and somewhere I picked up >>> that to make sure I can restore the full glory of Shape, I needed >>> this line in ApplicationController >>> >>> model :Shape >>> >>> So, of course, I also have a file /app/models/shape.rb >>> >>> All was working well, but then I decided I''d rather name the model >>> MyShape. >>> >>> So, I >>> - edited the filename to "my_shape.rb" >>> - edited the shape.rb file to "class MyShape < AR" >>> - edited "model :MyShape" >>> >>> Now I get a "missing model error." >>> >>> Dude, it''s right there, I can see it. >> >> Have you tried clearing out your sessions. I''m guessing that it''s >> trying to restore your session, and since your session was created >> before you made the change it contains an instance of Shape, not >> MyShape. >>> >>> >>> However, I can''t find where I picked up that I needed to add the >>> ''model'' line. So, I can''t remember all the details of why it''s >>> there, >>> what the rules are, what I am forgetting, etc. >>> >> I thought that was dead. >> >> Fred >>> Trying to figure out how to google for that one is a futile >>> exercise. >>> >>> Attempting to search various online docs for the Rails API are also >>> fruitless. >>> >>> Dazed, confused, and lost. And it was going so well for a while... >>> >>> -- gw >>> >>> >>> >>>> >> >> >>> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
>> I am storing a shape object in a session, and somewhere I picked up >> that to make sure I can restore the full glory of Shape, I needed >> this line in ApplicationController >> model :Shape >> So, of course, I also have a file /app/models/shape.rb >> >> All was working well, but then I decided I''d rather name the model >> MyShape. So, I >> - edited the filename to "my_shape.rb" >> - edited the shape.rb file to "class MyShape < AR" >> - edited "model :MyShape" >> >> Now I get a "missing model error." > > Have you tried clearing out your sessions.Yes.> Did you restart the server?Yes. In fact at this point, I''m trying both Shape and MyShape. So I have all the original Shape code. And it works. Then I have a new model (created by generate) called MyShape. I add the line model :MyShape and even though I don''t actually use it anywhere yet, I get that error. You''d think all it has to do at that point is look for that file, yeah? Weird.>> However, I can''t find where I picked up that I needed to add the >> ''model'' line. So, I can''t remember all the details of why it''s there, >> what the rules are, what I am forgetting, etc. > > I thought that was dead.So I don''t even need to bother with this ''model'' declaration? There''s no circumstances where it is needed (perhaps when not following some convention?) -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Nov 4, 2007, at 12:55 PM, William Pratt wrote:> *stale session. (what I get for doing 3 things at once)Yeah, I figured. I appreciate that helping me was one of those things :-) So, anyway, I nuked the model line, changed my names as needed, and everything works fine. So, for now I''ll just forget this ever happened, and worry about model :x some other day when I need to. Thanks guys. -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---