Module: TemporalTables::TemporalClass::STIWithHistory

Defined in:
lib/temporal_tables/temporal_class.rb

Instance Method Summary collapse

Instance Method Details

#find_sti_class(type_name) ⇒ Object



58
59
60
61
62
63
64
65
66
# File 'lib/temporal_tables/temporal_class.rb', line 58

def find_sti_class(type_name)
  type_name += 'History' unless type_name =~ /History\Z/

  begin
    super
  rescue ActiveRecord::SubclassNotFound
    superclass.send(:find_sti_class, type_name)
  end
end

#sti_nameObject



54
55
56
# File 'lib/temporal_tables/temporal_class.rb', line 54

def sti_name
  super.sub(/History$/, '')
end