From f37c27a243c526b4d75cb0534650126e5ee2d6ae Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 30 Oct 2020 14:44:42 +0100 Subject: [PATCH] nicer find_field --- app/models/procedure_presentation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/procedure_presentation.rb b/app/models/procedure_presentation.rb index 7ee650812..2955db5ba 100644 --- a/app/models/procedure_presentation.rb +++ b/app/models/procedure_presentation.rb @@ -263,7 +263,7 @@ class ProcedurePresentation < ApplicationRecord end def find_field(table, column) - fields.find { |c| c['table'] == table && c['column'] == column } + fields.find { |field| field.values_at('table', 'column') == [table, column] } end def check_allowed_displayed_fields