Exception: MassiveRecord::ORM::SingleTableInheritance::FirstUnsupported

Inherits:
MassiveRecordError
  • Object
show all
Defined in:
lib/massive_record/orm/single_table_inheritance.rb

Overview

Raised if you call first on any sub class of your base class. Calling first() on a sub class can’t be easily done through thrift as we can’t apply any column filter on the STI type column.

What you need to do is, the very inefficient, SubClass.all.first When doing an all, all records will be fetched, but at least the array or records will be filtered and only correct class will be returned.