From aa41c8c082d17614dbd732dc190a9a27682a9338 Mon Sep 17 00:00:00 2001 From: OKURA Masafumi Date: Fri, 13 Oct 2023 12:50:10 +0900 Subject: [PATCH] [Lint] Sorry but I want to use `OpenStruct` here Probably there's some better way, but I'd like to prioritize quick release. --- lib/alba/conditional_attribute.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/alba/conditional_attribute.rb b/lib/alba/conditional_attribute.rb index 25634ae..5948989 100644 --- a/lib/alba/conditional_attribute.rb +++ b/lib/alba/conditional_attribute.rb @@ -51,6 +51,8 @@ def with_two_arity_proc_condition # OpenStruct is used as a simple solution for converting Hash or Array of Hash into an object # Using OpenStruct is not good in general, but in this case there's no other solution + # rubocop:disable Style/OpenStructUse + # rubocop:disable Performance/OpenStruct def objectize(fetched_attribute) return fetched_attribute unless @body.is_a?(Alba::Association) @@ -62,5 +64,7 @@ def objectize(fetched_attribute) OpenStruct.new(fetched_attribute) end end + # rubocop:enable Style/OpenStructUse + # rubocop:enable Performance/OpenStruct end end