Skip to content

Commit

Permalink
cop
Browse files Browse the repository at this point in the history
  • Loading branch information
paneq committed Nov 1, 2024
1 parent b033144 commit f840c45
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/granite/form/model/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,9 @@ def initialize_copy(_)
private

def report_unknown_attribute(attribute_type, name)
if self.class.mass_assignment_strict_mode
raise ActiveModel::UnknownAttributeError.new(self, name.to_s)
else
logger.debug("Ignoring #{attribute_type} `#{name}` attribute value for #{self} during mass-assignment")
end
raise ActiveModel::UnknownAttributeError.new(self, name.to_s) if self.class.mass_assignment_strict_mode

logger.debug("Ignoring #{attribute_type} `#{name}` attribute value for #{self} during mass-assignment")
end

def attributes_for_inspect
Expand Down

0 comments on commit f840c45

Please sign in to comment.