Skip to content

Commit

Permalink
Temporarly revert "In permitted_attributes, switch from database colu…
Browse files Browse the repository at this point in the history
…mn detection to Rails attributes detection. Fixes #838"

This reverts commit 530a202.

Reason: Adjust tests to obtain a before and after picture
  • Loading branch information
kalsan committed May 19, 2024
1 parent 530a202 commit 1195d39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cancan/ability/strong_parameter_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1195d39

Please sign in to comment.