Index: app/models/user_preference.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb --- a/app/models/user_preference.rb (revision cab88f922c43374247028dae949e731f31e1155f) +++ b/app/models/user_preference.rb (revision d7abde0de2bf433125e58e4e3d895428144b38e7) @@ -59,7 +59,8 @@ self.no_self_notified = Setting.default_users_no_self_notified end unless attributes && attributes.key?(:auto_watch_on) - self.auto_watch_on = AUTO_WATCH_ON_OPTIONS + value = Setting.default_users_auto_watch_on + self.auto_watch_on = value.nil? ? AUTO_WATCH_ON_OPTIONS : value end end self.others ||= {} Index: app/views/settings/_users.html.erb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/app/views/settings/_users.html.erb b/app/views/settings/_users.html.erb --- a/app/views/settings/_users.html.erb (revision cab88f922c43374247028dae949e731f31e1155f) +++ b/app/views/settings/_users.html.erb (revision d7abde0de2bf433125e58e4e3d895428144b38e7) @@ -20,6 +20,7 @@

<%= setting_select(:default_notification_option, User.valid_notification_options.collect {|o| [l(o.last), o.first.to_s]}) %>

<%= setting_check_box :default_users_no_self_notified, :label => :label_user_mail_no_self_notified %>

<%= setting_select :default_users_time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :label => :field_time_zone, :blank => :label_none %>

+

<%= setting_multiselect :default_users_auto_watch_on, UserPreference::AUTO_WATCH_ON_OPTIONS.map {|o| [l("label_auto_watch_on_#{o}"), o]}, :label => :label_auto_watch_on %>

Index: config/settings.yml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/config/settings.yml b/config/settings.yml --- a/config/settings.yml (revision cab88f922c43374247028dae949e731f31e1155f) +++ b/config/settings.yml (revision d7abde0de2bf433125e58e4e3d895428144b38e7) @@ -287,6 +287,11 @@ default: 1 default_users_time_zone: default: "" +default_users_auto_watch_on: + serialized: true + default: + - issue_created + - issue_contributed_to # encodings used to convert files content to UTF-8 # multiple values accepted, comma separated repositories_encodings: Index: test/unit/user_preference_test.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/test/unit/user_preference_test.rb b/test/unit/user_preference_test.rb --- a/test/unit/user_preference_test.rb (revision cab88f922c43374247028dae949e731f31e1155f) +++ b/test/unit/user_preference_test.rb (revision d7abde0de2bf433125e58e4e3d895428144b38e7) @@ -56,8 +56,21 @@ end def test_auto_watch_on_should_default_to_setting - preference = UserPreference.new - assert_equal %w[issue_created issue_contributed_to], preference.auto_watch_on + with_settings :default_users_auto_watch_on => ['issue_created'] do + preference = UserPreference.new + assert_equal ['issue_created'], preference.auto_watch_on + end + with_settings :default_users_auto_watch_on => [] do + preference = UserPreference.new + assert_equal [], preference.auto_watch_on + end + end + + def test_auto_watch_on_should_default_to_options + with_settings :default_users_auto_watch_on => nil do + preference = UserPreference.new + assert_equal %w[issue_created issue_contributed_to], preference.auto_watch_on + end end def test_create