Skip to content

A platform for community discussion. Free, open, simple.

FIX: Flagged Post custom fields were not respecting type

Robin Ward410b0f591fff
diff --git a/lib/flag_query.rb b/lib/flag_query.rb
index 0c8cbe95540..34d523bdbc0 100644
--- a/lib/flag_query.rb
+++ b/lib/flag_query.rb
@@ -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] }