jackdempsey / sequel_polymorphic

MIT License
37 stars 13 forks source link

possible to get "uninitialized constant" errors #7

Closed jmay closed 9 years ago

jmay commented 9 years ago

In your README example, if you try Asset.first.attachable then you will get uninitialized constant Attachable. For some reason it isn't realizing that it should be fetching a Note instead of an Attachable.

Works fine if you start with the Note and try to do a round-trip, i.e. note.assets.first.attachable.

kuraga commented 9 years ago

Error appears in sequel 4.15.0, commit that causes this error:

The only fallout from this change is that reciprocal_type for
many_to_one associations now needs access to the associated class
if not cached, so when caching is disabled, if there isn't a
single associated class (such as when using manually creating a
custom polymorphic association), you should manually set the
:reciprocal_type option.