rails-erd icon indicating copy to clipboard operation
rails-erd copied to clipboard

Keyword :as not supported?

Open renevanpelt opened this issue 10 years ago • 4 comments

Installing and running was as smooth as it could be, however, I immediately get an ArgumentError because the :as keyword is used in my polymophic associations. Any tips?

Failed: ArgumentError: Unknown key: :as. Valid keys are: :class_name, :class, :foreign_key, :validate, :autosave, :remote, :dependent, :primary_key, :inverse_of, :foreign_type, :polymorphic, :touch, :counter_cache

renevanpelt avatar Dec 30 '14 08:12 renevanpelt

Odd! I'll take a look this week.

kerrizor avatar Dec 31 '14 18:12 kerrizor

I'm having the same issue. However, when I comment all the :as lines, the ArgumentError still appears, now in a different way:

ArgumentError: Unknown key: :polymorphic. Valid keys are: :class_name, :anonymous_class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type

Wurzelkoch avatar Oct 20 '16 09:10 Wurzelkoch

Thanks for the info! I'm on vacation until November 1 but will be doing some work on the gem that week and will try to nail this one down.

On Thursday, October 20, 2016, Wurzelkoch [email protected] wrote:

I'm having the same issue. However, when I comment all the :as lines, the ArgumentError still appears, now in a different way:

ArgumentError: Unknown key: :polymorphic. Valid keys are: :class_name, :anonymous_class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/voormedia/rails-erd/issues/112#issuecomment-255062831, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPumQOBGO5XzMK9_QakzRLPqW1umdXFks5q1zswgaJpZM4DNHmb .

kerrizor avatar Oct 20 '16 10:10 kerrizor

Right now, I noticed that the problem is likely not in rails-erd, but in activesupport. Rails console fails as well. I suppose the problem is that certain polymorphic associations don't work at all. I tried to establish a collection (has_many) that should contain objects of two different classes a case that is not even mentioned in rails manuals.

Wurzelkoch avatar Oct 20 '16 11:10 Wurzelkoch