- elsif 'components'.in? changed_attributes
- if !self.state || self.state == New || !self.active
- if self.components_look_ready?
- self.state = Ready
- else
- self.state = New
- end
+ elsif new_record? and self.state.nil?
+ # No state, active, or success given
+ self.state = New
+ end
+
+ if new_record? or 'components'.in? changed_attributes
+ self.state ||= New
+ if self.state == New and self.components_look_ready?
+ self.state = Ready