-
Notifications
You must be signed in to change notification settings - Fork 876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid single-table inheritance type: Ckeditor::Picture is not a subclass of Ckeditor::Picture #739
Comments
Rails 5.1 add .to_i for pictures_controller.rb also Help!!!! |
I stumbled across this while researching the same problem in a personal project I'm working on. The source of the problem seems to be code reloading (specifically constant reloading?) in development mode, as hinted at in the previously closed issue with the reproduction steps. When you edit one of these models and re-run something in a console or refresh a web request without restarting the console/webserver, you'll bump into this issue. In my case I'm also using spring, and the problem doesn't go away until I Unfortunately I have no idea what the actual source of the problem is. Someone I spoke with recently suggested using |
I was experiencing this today on STI inheritance. Adding 'unloadable' to the inheriting class fixed it for me. |
Apologies for chiming in again even though I'm not using ckeditor, and my problem is unrelated 😸 but I actually recently managed to (sorta) track down the root of the problem here. It seems that (some? all?) class constants are being undefined/redefined somewhere during the code reloading process in a rails development environment, after which the actual ruby objects stored in those class constants are no longer equal. That means the following line fails due to inequality: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/inheritance.rb#L202 If I monkeypatch that line to read |
Another way to fix this is to add the following to the generated self.inheritance_column = nil which tells Rails to ignore the |
I'm also not using ckeditor, but ran across this looking for some explanation for my problem (I'm not trying to use |
I also have this issue. And the error is miss leading because there was another error happen before that when I check rails log. Here is my fix: https://stackoverflow.com/a/50767069/9516571 |
Similar to the answer from ericcf, I put into
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still facing this on Rails 5.2.2 and gem version 4.2.4 |
This project is obviously dead... |
@FreeApophis last commit was 19 days ago, has a low number of issues opened, has comments on recent issues opened ... it's not dead. |
The Issue count is only low because they closed hundreds of bugs like this one with the stale bot. The Commit 19 days ago was only to include the stale bot. The last commit before that one was in March. This project is dead. |
What is dead may never die... |
I was also face same issue, updating my gems everything is OK right now, hope this help. |
type keyword is a reserved word for ActiveRecord. Need column type rename. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
ping |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
nope still not stale, just no maintainer. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am about to write an unstale bot... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
nope... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I dont care if the project is dead, this ticket stays open |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Just checked, this is still an issue in development environment only as it is caused by code reloading (which is also why it doesn't always happen - see Rails issue). If you encounter the issue a manual stop/start of your server should resolve it. I've had a look but can't find the root cause, the Pinning to prevent the stale bot from closing. |
having same issue on rails 6.1.7.3,
then used ericcf suggestion he's posted on may 24 2017
this 2 actions has solved my issues, now it seems be working fine!! |
This is a duplicate of Bug #680 which was closed by the author, but the Bug is real and still in the current stable release.
The Column Name type (not sure if *_type as well) is reserved for polymorphic associations, thats why Rails is complaining (sometimes). Maybe the bug only appears when you actually use polymorphic associations on other models.
Please rename at least the following column: "type"
And it would probably better to rename "data_content_type" unless it is used for a polymorphic associations, which I could not test, because it crashes before any data can be saved in that column.
See: http://stackoverflow.com/questions/20357997/invalid-single-table-inheritance-type-rails
Or: https://www.ruby-forum.com/topic/103871
The text was updated successfully, but these errors were encountered: