From 45f25305372a5417ee17a0539efa3a5e83831506 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 6 Jan 2020 23:22:55 -0600 Subject: [PATCH] /ip_addresses: fix 'missing attribute: model_id' error Fix crash on /ip_addresses page when using the group by option. Caused by attempting to include model_id in the data attributes when it isn't present when using this option. Fix is to only include attributes that are actually present. --- app/models/ip_address.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/ip_address.rb b/app/models/ip_address.rb index add206bbc..ee8b2c1ad 100644 --- a/app/models/ip_address.rb +++ b/app/models/ip_address.rb @@ -42,4 +42,8 @@ class IpAddress < ApplicationRecord def readonly? true end + + def html_data_attributes + super & attributes.keys.map(&:to_sym) + end end