Fixed: editing a message may cause sticky attribute to be NULL (#3356).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2787 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-06-14 09:19:20 +00:00
parent 5e76040256
commit 7642b5a9ab
3 changed files with 28 additions and 0 deletions
+4
View File
@@ -66,6 +66,10 @@ class Message < ActiveRecord::Base
board.reset_counters!
end
def sticky=(arg)
write_attribute :sticky, (arg == true || arg.to_s == '1' ? 1 : 0)
end
def sticky?
sticky == 1
end