Remove uneccesary save when setting notification settings on user

These methods should behave as the rest of setters on
ActiveRecords, ergo setting the model state, but not saving it.

The save is called at the end of the action inside the controller
anyway, so this save is redundant.
This commit is contained in:
Luka Murn 2018-05-18 13:43:04 +02:00
parent c3d247faae
commit 5e90ae7383

View file

@ -431,7 +431,6 @@ class User < ApplicationRecord
define_method("#{name}=") do |value|
attr_name = name.gsub('_notification', '').to_sym
notifications_settings[attr_name] = value
save
end
end