From 4c3b4671efabdfab195a51e49058e62e6fa6436b Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 18 Aug 2020 11:14:18 -0500 Subject: [PATCH] ip addresses: fix exception on ip_addresses/show page. --- app/policies/ip_address_policy.rb | 2 +- test/functional/ip_addresses_controller_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/policies/ip_address_policy.rb b/app/policies/ip_address_policy.rb index fecd6dd23..209ccb541 100644 --- a/app/policies/ip_address_policy.rb +++ b/app/policies/ip_address_policy.rb @@ -4,6 +4,6 @@ class IpAddressPolicy < ApplicationPolicy end def html_data_attributes - super & attributes.keys.map(&:to_sym) + super & record.attributes.keys.map(&:to_sym) end end diff --git a/test/functional/ip_addresses_controller_test.rb b/test/functional/ip_addresses_controller_test.rb index b4c212e50..ad98fd5d3 100644 --- a/test/functional/ip_addresses_controller_test.rb +++ b/test/functional/ip_addresses_controller_test.rb @@ -43,12 +43,12 @@ class IpAddressesControllerTest < ActionDispatch::IntegrationTest context "show action" do should "be visible to mods" do - get_auth ip_address_path("1.1.1.1"), @mod + get_auth ip_address_path("1.2.3.4"), @mod assert_response :success end should "not be visible to members" do - get_auth ip_address_path("1.1.1.1"), @user + get_auth ip_address_path("1.2.3.4"), @user assert_response 403 end end