Smart class parameters with ERB snippets are broken for other that String types
|Assigned To:||Marek Hulán|
|Found in release:||Pull request:||https://github.com/theforeman/foreman/pull/2080|
|Velocity based estimate||-|
Smart class parameters currently have broken validation and type-casting when used with ERB snippets. It tries to validate the value with the ERB without evaluation when key is being saved. It was hacked around it in Staypuft. How to fix it: Validation and type-casting has to be done on classification when ERB can be evaluated; SafeRender needs to be aware of the ERB parameters, they need to be validated and properly type-casted based on the given KeyValue (this association is missing currently).
The hack for Staypuft is in this file https://github.com/theforeman/staypuft/blob/master/app/models/staypuft/concerns/lookup_key_extensions.rb