Rails Ruby

Tableless model with associations in Rails 3.2

While upgrading a Rails 2.3.4 app to version 3.2 I came across a tableless model that had associations, in version 2.3.4 this works:

See the gist on github.

But in Rails 3.2 it doesn’t work anymore because it complains about the missing table, after trying several changes I was able to get it working with just one magic line:

See the gist on github.

Now you got associations again!

Leave a Reply