self.time_zone = Setting.default_users_time_zone
end
unless attributes && attributes.key?(:no_self_notified)
- self.no_self_notified = true
+ self.no_self_notified = Setting.default_users_no_self_notified
end
end
self.others ||= {}
<p><%= setting_select(:default_notification_option, User.valid_notification_options.collect {|o| [l(o.last), o.first.to_s]}) %></p>
+ <p><%= setting_check_box :default_users_no_self_notified, :label => :label_user_mail_no_self_notified %></p>
+
<p><%= setting_select :default_users_time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :label => :field_time_zone, :blank => :label_none %></p>
</fieldset>
default: 0
default_users_hide_mail:
default: 1
+default_users_no_self_notified:
+ default: 1
default_users_time_zone:
default: ""
# encodings used to convert files content to UTF-8
assert_equal true, preference.no_self_notified
end
+ def test_no_self_notified_should_default_to_setting
+ with_settings :default_users_no_self_notified => '0' do
+ preference = UserPreference.new
+ assert_equal false, preference.no_self_notified
+ end
+ end
+
def test_create
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
user.login = "newuser"