From 5e90ae7383143cca6821e3071214001a033cbb15 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Fri, 18 May 2018 13:43:04 +0200 Subject: [PATCH] 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. --- app/models/user.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index a5b925c35..e0f617f08 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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