diff --git a/app/models/design/design.rb b/app/models/design/design.rb index 9346c175..1d4a5284 100644 --- a/app/models/design/design.rb +++ b/app/models/design/design.rb @@ -86,10 +86,14 @@ class Design def process_object(object) if object.to_save - new_object = self.send(object._type.downcase.pluralize).build - new_object.file = object.file - object.destroy - new_object.save + if object.file_filename.nil? + new_object = self.send(object._type.downcase.pluralize).build + new_object.file = object.file + object.destroy + new_object.save + else + object.save + end end if object.to_destroy object.destroy diff --git a/app/views/admin/designs/_design_file.html.erb b/app/views/admin/designs/_design_file.html.erb index 3fbb9ab4..205b5350 100644 --- a/app/views/admin/designs/_design_file.html.erb +++ b/app/views/admin/designs/_design_file.html.erb @@ -11,7 +11,7 @@ <% end %> <%= t('Delete') %> <% end %> - <% if classes.include?('r_editable') %> + <% if classes.include?('r_edit') %> <%= t('Edit') %> <% end %> diff --git a/app/views/admin/designs/_form.html.erb b/app/views/admin/designs/_form.html.erb index 8095e9fd..9a857f43 100644 --- a/app/views/admin/designs/_form.html.erb +++ b/app/views/admin/designs/_form.html.erb @@ -36,11 +36,11 @@ <% end %>
- <%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "themes", :f => f, :classes => "r_destroy, r_editable" } %> + <%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "themes", :f => f, :classes => "r_destroy, r_edit" } %>
- <%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "javascripts", :f => f, :classes => "r_destroy, r_editable" } %> + <%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "javascripts", :f => f, :classes => "r_destroy, r_edit" } %>