active_mocker icon indicating copy to clipboard operation
active_mocker copied to clipboard

Support polymorphic associations

Open markburns opened this issue 9 years ago • 3 comments

Usage of polymorphic associations results in an exception

e.g.

Missing model Bar for association Foo.belongs_to :bar, polymorphic: true

markburns avatar Apr 26 '16 06:04 markburns

This is known limitation of active_mocker. To add this feature it would take adjustments in the generation code as well the in-memory query engine. If you like assist with the process what would make things move faster would a PR with all the needed models and a failing testing in active_record_compatible_api.rb

zeisler avatar May 01 '16 00:05 zeisler

I'm also trying to use a polymorphic association but the error I'm getting is

Polymorphic association does not support to compute class.

Is the polymorphic associations features already implemented? What does this error means and is there a way to solve it?

RepoCorp avatar Sep 20 '18 17:09 RepoCorp

@RepoCorp Can you provide more context? I don't believe that error is coming from this gem. Given that, work has not been done to officially support polymorphic associations, but in some cases it might work.

zeisler avatar Sep 20 '18 20:09 zeisler