Fixed: default flag removed when editing a default enumeration (#2327).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2123 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2008-12-12 13:32:39 +00:00
1 parent 72d0843c1f
commit c651184998
2 files changed
+40 -1

No files matched your search

+3 -1
View File
@@ -44,7 +44,9 @@ class Enumeration < ActiveRecord::Base
end
def before_save
Enumeration.update_all("is_default = #{connection.quoted_false}", {:opt => opt}) if is_default?
if is_default? && is_default_changed?
Enumeration.update_all("is_default = #{connection.quoted_false}", {:opt => opt})
end
end
def objects_count