voormedia / rails-erd

Generate Entity-Relationship Diagrams for Rails applications
http://voormedia.github.io/rails-erd/
MIT License
3.99k stars 364 forks source link

Keyword :as not supported? #112

Open renevanpelt opened 9 years ago

renevanpelt commented 9 years ago

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

kerrizor commented 9 years ago

Odd! I'll take a look this week.

Wurzelkoch commented 7 years ago

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

kerrizor commented 7 years ago

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 notifications@github.com 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 .

Wurzelkoch commented 7 years ago

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.