Fix categories

This commit is contained in:
2023-08-07 13:57:48 +10:00
parent 86d2209505
commit 79efc56cd8

View File

@@ -84,7 +84,13 @@ module Adamantium
name: params[:name],
slug: params[:slug] || params[:"mp-slug"],
published_at: (params[:"post-status"] == "draft") ? nil : publish_time,
category: params[:category].split(",") || [],
category: (if params[:category].is_a?(Array)
params[:category]
elsif params[:category].is_a?(String)
params[:category].split(",")
else
[]
end),
photos: photos,
location: params[:location],
content: content