/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.
This commit is contained in:
evazion
2020-01-06 23:22:55 -06:00
parent 052008ee5d
commit 45f2530537

View File

@@ -42,4 +42,8 @@ class IpAddress < ApplicationRecord
def readonly?
true
end
def html_data_attributes
super & attributes.keys.map(&:to_sym)
end
end