Read more

Get the root class of an ActiveRecord STI hierarchy

Henning Koch
August 12, 2015Software engineer at makandra GmbH

Use base_class Show archive.org snapshot .

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

This traverses up the hierarchy until it encounters either

  • a class inheriting from ActiveRecord::Base or
  • a class inheriting from an abstract class (inheriting from ActiveRecord::Base)
Posted by Henning Koch to makandra dev (2015-08-12 11:46)