case_transform
case_transform copied to clipboard
New Method `underscore_without_question_mark` to get rid of question marks
trafficstars
New Method underscore_without_question_mark to get rid of question marks in boolean methods.
I followed the discussion in the active_model_serializers project, but the solutions there are only valid for <= 0.10.2.
I guess there are more elegant ways to do this, but for this the code in active_model_serializers would need adjustment as well (e.g. pass an options hash to the CamelCase.transform method at https://github.com/rails-api/active_model_serializers/blob/v0.10.4/lib/active_model_serializers/adapter/base.rb#L34).