Content
View differences
Updated by Wieland Lindenthal over 5 years ago
Currently when writing the contracts for models using single table inheritance we need to take special care in terms of writability and validation for the `:type` attribute which holds the current object's class name. See for an example here [https://github.com/opf/openproject/blob/c3256aba9b7b50554e09ec34cfb068be6460d221/app/contracts/placeholder\_users/create\_contract.rb#L42](https://github.com/opf/openproject/blob/c3256aba9b7b50554e09ec34cfb068be6460d221/app/contracts/placeholder_users/create_contract.rb#L42)
I believe that the `:type` attribute is something very ActiveRecord internal and should not "spill out" to higher layers such as contract unless it is really necessary.
I believe that the `:type` attribute is something very ActiveRecord internal and should not "spill out" to higher layers such as contract unless it is really necessary.