Forum: Ruby on Rails Polymorphic associations

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rath -. (Guest)
on 2006-03-23 23:21
I have just updated rails and added polymorphic associations but they
are not working properly. I'm following the recipe 17 of "Rails Recipes"
and I'm getting an "Unknown key(s): as" error. These associations work
properly on the console. The problem occurs when I'm listing the
items... perhaps the problem is pagination. Is this a bug or what should
I do?

Here is the log:
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/core_ext/hash/keys.rb:48:in
`assert_valid_keys'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations.rb:438:in
`has_one_without_reflection'
(eval):5:in `has_one'
#{RAILS_ROOT}/app/models/person.rb:4
#{RAILS_ROOT}/app/controllers/company_controller.rb:7:in `list'
-e:3
Rath -. (Guest)
on 2006-03-24 00:39
I think, it is working after all. I had to restart the computer and that
was all... perhaps the old sessions were there. I have seen somewhere a
script to remove old sessions, does anyone knows that script?

Thanks
Justin F. (Guest)
on 2006-03-24 02:39
(Received via mailing list)
Rath wrote:
> I think, it is working after all. I had to restart the computer and that
> was all... perhaps the old sessions were there. I have seen somewhere a
> script to remove old sessions, does anyone knows that script?

I don't know about a script - from your previous post it appears you are
on Windows, so your session files should be in:

   C:\Documents and Settings\YourUserName\Local Settings\Temp

with names of the form:

   ruby_sess.5e85a819a49ed1c2

...just delete those files.

regards

   Justin
Rick O. (Guest)
on 2006-03-24 04:26
(Received via mailing list)
On 3/23/06, Rath <removed_email_address@domain.invalid> wrote:
> I think, it is working after all. I had to restart the computer and that
> was all... perhaps the old sessions were there. I have seen somewhere a
> script to remove old sessions, does anyone knows that script?
>
> Thanks

You have to restart your app when the rails framework has been updated.

--
Rick O.
http://techno-weenie.net
Rath (Guest)
on 2006-03-28 05:43
Thanks guys

It was just that, I restarted my computer and everything worked fine. I
tried removing the session files and didn't work at the begining.

Rick O. wrote:
> On 3/23/06, Rath <removed_email_address@domain.invalid> wrote:
>> I think, it is working after all. I had to restart the computer and that
>> was all... perhaps the old sessions were there. I have seen somewhere a
>> script to remove old sessions, does anyone knows that script?
>>
>> Thanks
>
> You have to restart your app when the rails framework has been updated.
>
> --
> Rick O.
> http://techno-weenie.net
Alex Y. (Guest)
on 2006-03-28 10:57
(Received via mailing list)
Rath wrote:
> Thanks guys
>
> It was just that, I restarted my computer and everything worked fine. I
> tried removing the session files and didn't work at the begining.
Which OS are you using?  You shouldn't need to restart the whole
machine, just the app...
This topic is locked and can not be replied to.