From d7f2f9978d5095a22d8432c2aaa9bae3aa1c4d6a Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 20 Jan 2020 09:41:27 +1100 Subject: [PATCH] Handle when integer type custom field returns array --- lib/qa_post_edits.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/qa_post_edits.rb b/lib/qa_post_edits.rb index 3d0e5aa..cbc9371 100644 --- a/lib/qa_post_edits.rb +++ b/lib/qa_post_edits.rb @@ -111,8 +111,8 @@ class ::Post self.ignored_columns = %w(vote_count) def qa_vote_count - if custom_fields['vote_count'].present? - custom_fields['vote_count'].to_i + if vote_count = custom_fields['vote_count'] + [*vote_count].first.to_i else 0 end