Rails : Formtastic : Single Table Inheritance : Issues and solution

I have been using Formtastic from the beginning and then some feature changes came across my application. I had a model called `DrugTest` then I also needed to implement additional drugtest (hair test and alcohol test). So I thought STI would be a perfect match to my scenario.

I created two classes `AdditionalHairDrugTest` and `AdditionalAlcoholDrugTest` derived from the model `DrugTest`

# == Schema Information
# Table name: drug_tests
# type :string
# ...
class AdditionalAlcoholDrugTest < DrugTest
 belongs_to :pact
 belongs_to :user
 default_scope -> {where(type: :AdditionalAlcoholDrugTest)}

 def is_additional?

Now I encountered this error Continue reading