Skip to content

Commit

Permalink
Merge pull request #3974 from nebulab/kennyadsl/remove-deprecation
Browse files Browse the repository at this point in the history
Remove deprecated attachment_partial_name
  • Loading branch information
kennyadsl authored Mar 5, 2021
2 parents 93bfdb4 + 46cb596 commit 6cfd233
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 49 deletions.
28 changes: 12 additions & 16 deletions backend/app/views/spree/admin/taxons/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,18 @@
</div>
<% end %>

<% if f.object.class.attachment_definitions.size > 1 %>
<%= render "spree/admin/taxons/attachment_forms/#{f.object.attachment_partial_name}", f: f %>
<% else %>
<%= f.field_container :icon do %>
<%= f.label :icon %><br>
<%= f.file_field :icon %>
<% if f.object.icon_present? %>
<%= image_tag f.object.icon(:mini) %>
<%= link_to t('spree.actions.remove'),
admin_taxonomy_taxon_attachment_path(@taxonomy,
@taxon.id,
attachment_definition: :icon,
authenticity_token: form_authenticity_token),
method: :delete,
class: 'btn btn-sm btn-danger' %>
<% end %>
<%= f.field_container :icon do %>
<%= f.label :icon %><br>
<%= f.file_field :icon %>
<% if f.object.icon_present? %>
<%= image_tag f.object.icon(:mini) %>
<%= link_to t('spree.actions.remove'),
admin_taxonomy_taxon_attachment_path(@taxonomy,
@taxon.id,
attachment_definition: :icon,
authenticity_token: form_authenticity_token),
method: :delete,
class: 'btn btn-sm btn-danger' %>
<% end %>
<% end %>
</div>
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions core/app/models/spree/taxon/active_storage_attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ module Spree::Taxon::ActiveStorageAttachment
default_style: :mini
validate :icon_is_an_image
end

def attachment_partial_name
Spree::Deprecation.warn("calling #attachment_partial_name on Spree::Taxon is deprecated without replacement.")
'paperclip'
end
end
5 changes: 0 additions & 5 deletions core/app/models/spree/taxon/paperclip_attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ def icon_present?
icon.present?
end

def attachment_partial_name
Spree::Deprecation.warn("calling #attachment_partial_name on Spree::Taxon is deprecated without replacement.")
'paperclip'
end

def destroy_attachment(definition)
return false unless respond_to?(definition)

Expand Down

0 comments on commit 6cfd233

Please sign in to comment.