From 1195d3916abe2a5500582c261df2dc29e3309dd3 Mon Sep 17 00:00:00 2001 From: Sandro Kalbermatter Date: Sun, 19 May 2024 14:22:33 +0200 Subject: [PATCH] Temporarly revert "In permitted_attributes, switch from database column detection to Rails attributes detection. Fixes #838" This reverts commit 530a20248b705fffd5c60f350d823f8a13596b19. Reason: Adjust tests to obtain a before and after picture --- lib/cancan/ability/strong_parameter_support.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cancan/ability/strong_parameter_support.rb b/lib/cancan/ability/strong_parameter_support.rb index 892d250a3..31da74574 100644 --- a/lib/cancan/ability/strong_parameter_support.rb +++ b/lib/cancan/ability/strong_parameter_support.rb @@ -31,7 +31,7 @@ def get_attributes(rule, subject) klass = subject_class?(subject) ? subject : subject.class # empty attributes is an 'all' if rule.attributes.empty? && klass < ActiveRecord::Base - klass.attribute_names.map(&:to_sym) - Array(klass.primary_key) + klass.column_names.map(&:to_sym) - Array(klass.primary_key) else rule.attributes end