OSDN Git Service
(root)
/
redminele
/
redmine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec4ba23
)
Avoid useless database queries.
author
Jean-Philippe Lang
<jp_lang@yahoo.fr>
Fri, 20 Nov 2009 12:57:52 +0000
(12:57 +0000)
committer
Jean-Philippe Lang
<jp_lang@yahoo.fr>
Fri, 20 Nov 2009 12:57:52 +0000
(12:57 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3077
e93f8b46
-1217-0410-a6f0-
8f06a7374b81
app/models/custom_value.rb
patch
|
blob
|
history
diff --git
a/app/models/custom_value.rb
b/app/models/custom_value.rb
index
4cace72
..
39ba599
100644
(file)
--- a/
app/models/custom_value.rb
+++ b/
app/models/custom_value.rb
@@
-20,7
+20,7
@@
class CustomValue < ActiveRecord::Base
belongs_to :customized, :polymorphic => true
def after_initialize
- if
custom_field && new_record?
&& (customized_type.blank? || (customized && customized.new_record?))
+ if
new_record? && custom_field
&& (customized_type.blank? || (customized && customized.new_record?))
self.value ||= custom_field.default_value
end
end