FIX: Flagged Post custom fields were not respecting type

This commit is contained in:
Robin Ward 2018-08-21 15:33:15 -04:00
parent 357df2ff4f
commit 410b0f591f
1 changed files with 1 additions and 7 deletions

View File

@ -140,13 +140,7 @@ module FlagQuery
post_custom_field_names << field if plugin.enabled?
end
post_custom_fields = {}
if post_custom_field_names.present?
PostCustomField.where(post_id: post_ids, name: post_custom_field_names).each do |f|
post_custom_fields[f.post_id] ||= {}
post_custom_fields[f.post_id][f.name] = f.value
end
end
post_custom_fields = Post.custom_fields_for_ids(post_ids, post_custom_field_names)
# maintain order
posts = post_ids.map { |id| post_lookup[id] }