Skip to content

Commit

Permalink
Merge pull request #4048 from tvdeyen/fix-polymorphic-path-strings
Browse files Browse the repository at this point in the history
Use symbols in polymorphic path for event_links
  • Loading branch information
tvdeyen authored May 7, 2021
2 parents 69b9a0f + 1f089e3 commit 7cd6c4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/app/controllers/spree/admin/resource_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def parent
.find_by!(self.class.parent_data[:find_by] => params["#{parent_model_name}_id"])
instance_variable_set("@#{parent_model_name}", @parent)
rescue ActiveRecord::RecordNotFound => e
resource_not_found(flash_class: e.model.constantize, redirect_url: spree.polymorphic_url([:admin, parent_model_name.pluralize]))
resource_not_found(flash_class: e.model.constantize, redirect_url: spree.polymorphic_url([:admin, parent_model_name.pluralize.to_sym]))
end

def parent?
Expand Down
2 changes: 1 addition & 1 deletion backend/app/helpers/spree/admin/orders_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def event_links
translated_event = t(event, scope: [:spree, :admin, :order, :events])
links << button_to(
translated_event,
[event, :admin, @order],
[event.to_sym, :admin, @order],
method: :put,
data: { confirm: t(:order_sure_want_to, event: translated_event, scope: :spree) }
)
Expand Down

0 comments on commit 7cd6c4d

Please sign in to comment.