Skip to content

Commit 3594385

Browse files
committed
chore(views): guard Attributes#update_attributes send
1 parent d061344 commit 3594385

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/tiny_admin/views/attributes.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ module Views
55
module Attributes
66
def update_attributes(attributes)
77
attributes.each do |key, value|
8-
send("#{key}=", value)
8+
setter = "#{key}="
9+
unless respond_to?(setter)
10+
raise ArgumentError, "#{self.class.name} does not support attribute '#{key}'"
11+
end
12+
13+
send(setter, value)
914
end
1015
end
1116
end

0 commit comments

Comments
 (0)