STI class_name returns the parent class name

Is this a bug or intended action - or am I missing something.

If I have
class Thing < ActiveRecord::Base
class ZThing < Thing

and I do


Then z.class
returns ZThing(id: …etc
as I would expect

but z.class.class_name
returns Thing

which is a problem when I want to test for my STI class. Or should I
check for STI class name in a different way?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs