Polymorphic associations


#1

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:inhas_one_without_reflection’
(eval):5:in has_one' #{RAILS_ROOT}/app/models/person.rb:4 #{RAILS_ROOT}/app/controllers/company_controller.rb:7:inlist’
-e:3


#2

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


#3

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


#4

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


#5

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


#6

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…