ministryofjustice/atet

View on GitHub
app/types/array_of_strings_type.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ArrayOfStringsType < ActiveRecord::Type::Value
  def cast(value)
    if value.respond_to?(:map)
      value.map(&:to_s)
    else
      value
    end
  end
end