app/controllers/settings_controller.rb in social_stream-base-2.1.0 vs app/controllers/settings_controller.rb in social_stream-base-2.2.0
- old
+ new
@@ -1,9 +1,9 @@
class SettingsController < ApplicationController
-
+
before_filter :authenticate_user!
-
+
def index
end
def update_all
success = false
@@ -17,9 +17,19 @@
#Notify by email setting
if params[:notify_by_email].present?
notify_by_email = params[:notify_by_email].to_s
current_subject.notify_by_email = false if notify_by_email.eql? "never"
current_subject.notify_by_email = true if notify_by_email.eql? "always"
+ end
+
+ # Custom notification settings
+ if params[:notification_settings].present?
+ notification_settings = {}
+ params[:notification_settings].each_pair do |key, setting|
+ notification_settings[key.to_sym] = false if setting.eql? "never"
+ notification_settings[key.to_sym] = true if setting.eql? "always"
+ end
+ current_subject.update_attribute(:notification_settings, notification_settings)
end
end
#Updating language
if section.eql? "language"