ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Pleas

934 views
Skip to first unread message

Commander Johnson

unread,
Jun 8, 2012, 9:08:18 PM6/8/12
to rubyonra...@googlegroups.com
Hello,

I stumble upon this error when loading a subclass of the Transaction
class. For full details, see the pastie:

http://pastie.org/4053678

Error message: ActiveRecord::SubclassNotFound: The single-table
inheritance mechanism failed to locate the subclass:
'Transactions::DummyDdnlTransaction'. 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
Transactions::DummyDdnlTransaction.inheritance_column to use another
column for that information.

Have Googled around, tried solutions like self.subclasses and
require_dependency but they didn't work for me.

I'm on Rails 2.3.14.

cmdjohnson

Андрей Большов

unread,
Jun 9, 2012, 10:53:46 AM6/9/12
to rubyonra...@googlegroups.com

Answer in your error message rename  column " type", or 
Transactions::DummyDdnlTransaction.inheritance_column="not_type_column"

суббота, 9 июня 2012 г., 5:08:18 UTC+4 пользователь Commander Johnson написал:

Андрей Большов

unread,
Jun 9, 2012, 11:25:53 AM6/9/12
to rubyonra...@googlegroups.com
Sorry, in real it's about requiring class, try check if your subclasses class is loaded properly.

суббота, 9 июня 2012 г., 5:08:18 UTC+4 пользователь Commander Johnson написал:
Hello,

Matt Jones

unread,
Jun 9, 2012, 8:45:37 PM6/9/12
to rubyonra...@googlegroups.com
The autoloader is expecting to find Transactions::DummyDdnlTransaction in app/models/transactions/dummy_ddnl_transaction.rb - according to the Gist, you've got the file in the top level of app/models. Either move it, or manually require it.

--Matt Jones 
Reply all
Reply to author
Forward
0 new messages