diff --git a/lib/mysql-binuuid/type.rb b/lib/mysql-binuuid/type.rb index 8273fa6..6dac8f3 100644 --- a/lib/mysql-binuuid/type.rb +++ b/lib/mysql-binuuid/type.rb @@ -27,7 +27,8 @@ def cast(value) # Invoked when the provided value needs to be serialized before storing # it to the database. def serialize(value) - return if value.nil? + return if value.blank? + undashed_uuid = strip_dashes(value) # To avoid SQL injection, verify that it looks like a UUID. ActiveRecord