@ohadlevy, these are equivalent
```ruby
@hostgroup.parent = @parent
@hostgroup.parent_id = @parent.id
```
= @parent doesn't copy it's attributes.
since params[:hostgroup][:parent_id] exists @hostgroup.parent_id will be the correct value.
I did some re-factoring, but I think you we need to keep the 5 lines, 
ex. @hostgroup.architecture ||= @parent.architecture  ....