Skip to content

Commit

Permalink
Close #1963 Change the status from show_event_status to show_badge_st…
Browse files Browse the repository at this point in the history
…atus (#1964)

Co-authored-by: sreyleak <[email protected]>
  • Loading branch information
DethSreyleak and Sreyleak-Deth authored Oct 9, 2024
1 parent 3ee53ec commit 4b53968
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- insert_before "erb[loud]:contains('field_container :parent_id')" -->

<%= f.field_container :show_badge_status do %>
<%= f.label :show_badge_status, Spree.t('show_badge_status'), class: 'form-label' %>
<%= f.select :show_badge_status,
options_for_select([['On', true], ['Off', false]], f.object.show_badge_status),
{ },
{ class: 'select2 form-control' } %>
<%= f.error_message_on :show_badge_status, class: 'text-danger' %>
<% end %>

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def self.prepended(base)
base.has_one :web_banner, serializer: ::SpreeCmCommissioner::V2::Storefront::AssetSerializer
base.has_one :home_banner, serializer: ::SpreeCmCommissioner::V2::Storefront::AssetSerializer

base.attributes :custom_redirect_url, :kind, :subtitle, :from_date, :to_date, :background_color, :foreground_color, :show_event_status
base.attributes :custom_redirect_url, :kind, :subtitle, :from_date, :to_date, :background_color, :foreground_color, :show_badge_status
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/spree_permitted_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module PermittedAttributes
subtitle
preferred_background_color
preferred_foreground_color
show_event_status
show_badge_status
]

@@store_attributes += [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RenameShowEventStatusToShowBadgeStatusToSpreeTaxon < ActiveRecord::Migration[7.0]
def change
rename_column :spree_taxons, :show_event_status, :show_badge_status
change_column :spree_taxons, :show_badge_status, :boolean, default: false
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
:to_date,
:background_color,
:foreground_color,
:show_event_status
:show_badge_status
)
end

Expand Down

0 comments on commit 4b53968

Please sign in to comment.