Fixed: Oracle error when saving serialized setting (eg. mail notifications)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@742 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
eb371db5b9
commit
25012efc9c
|
@ -35,6 +35,11 @@ class Setting < ActiveRecord::Base
|
|||
v
|
||||
end
|
||||
|
||||
def value=(v)
|
||||
v = v.to_yaml if @@available_settings[name]['serialized'] && v.is_a?(String)
|
||||
write_attribute(:value, v)
|
||||
end
|
||||
|
||||
# Returns the value of the setting named name
|
||||
def self.[](name)
|
||||
v = @cached_settings[name]
|
||||
|
|
|
@ -36,4 +36,10 @@ class SettingTest < Test::Unit::TestCase
|
|||
# make sure db has been updated (UPDATE)
|
||||
assert_equal "My other title", Setting.find_by_name('app_title').value
|
||||
end
|
||||
|
||||
def test_serialized_setting
|
||||
Setting.notified_events = ['issue_added', 'issue_updated', 'news_added']
|
||||
assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.notified_events
|
||||
assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.find_by_name('notified_events').value
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue