I’ve seen this error before. Something in your params is messed up. Can you post the view containing the Game form? Ryan K Jan 28 ’15 at 16:16. ActiveRecordtype. Rails. 6594. ryonext 2013/11/26 Kobito;. This error is raised because the column ‘type’ is reserved for storing the class in case of inheritance. Ruby on Rails latest stable (v4.2.1) – 0 notes – Class: ClassMethods 1.
ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: movement is not a subclass of Movement And if I create movements with factory girl and later I want to get the first (for example) I have the following error:. This error is raised because the column ‘type’ is reserved for storing the class in case of inheritance. Please rename this column if you didn’t intend it to be used for storing the inheritance class or overwrite Movement. Single table inheritance (STI) in Rails allows you to store Ruby subclasses in the same database table. ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: PowerUser is not a subclass of User from /Users/siawyoung/. I recently tried to retrofit STI on a database table that had already existed for a while. ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: is not a subclass of Code.
Invalid single-table inheritance type: Rails. IT1Me.com is a tool for IT professionals to manage and build their skills, opportunities and career brand. Ruby on Rails supports Single Table Inheritance. Single Table Inheritance allows you to have one single SQL table, such as an employees table, manage different type of employees like managers and developers. A manager would normally have more responsibilities than a developer and you can separate these additional responsibilities in a different ActiveRecord model class. Alex Reisner has a post Single Table Inheritance in Rails, in which he advocates against mapping the resources of the child classes to the parent class in routes.
Problem With Enums In Rails Issue Github
Customizable database column name that is used to store the model type. Customizable string for the model type value stored in the database. Throwing Exceptions for Invalid Attributes. BY default the SingleTableInheritanceTrait will handle invalid attributes silently It ignores non-persisted attributes when a model is saved and ignores non-persisted columns when hydrating a model from a builder query. ActiveRecord::SubclassNotFound (Invalid single-table inheritance type: 1 is not a subclass of Theader): app/controllers/theaders_controller.rb:27:in create’ rails(ruby).