@@ -20,7 +20,7 class CustomValue < ActiveRecord::Base | |||||
20 | belongs_to :customized, :polymorphic => true |
|
20 | belongs_to :customized, :polymorphic => true | |
21 |
|
21 | |||
22 | def after_initialize |
|
22 | def after_initialize | |
23 |
if |
|
23 | if new_record? && custom_field && (customized_type.blank? || (customized && customized.new_record?)) | |
24 | self.value ||= custom_field.default_value |
|
24 | self.value ||= custom_field.default_value | |
25 | end |
|
25 | end | |
26 | end |
|
26 | end |
General Comments 0
You need to be logged in to leave comments.
Login now