Revision 87e23352
Added by Aditi Puntambekar almost 6 years ago
app/models/setting/email.rb | ||
---|---|---|
]
|
||
end
|
||
|
||
validates :value, :length => {:maximum => 255}, :if => Proc.new { |s| s.name == "email_subject_prefix" }
|
||
|
||
def self.load_defaults
|
||
# Check the table exists
|
||
return unless super
|
test/models/settings/email_setting_test.rb | ||
---|---|---|
assert_equal({"address" => "string@example.com", "authentication" => 'plain'}, Setting::Email.delivery_settings)
|
||
end
|
||
|
||
test 'value of email_subject_prefix should not be more than 255 characters' do
|
||
Setting[:email_subject_prefix] = 'p' * 256
|
||
refute_valid Setting::Email.new
|
||
end
|
||
|
||
private
|
||
|
||
def load_defaults
|
Also available in: Unified diff
Fixes #24057 - Email subject prefix accepts long strings (#5742)