app/decorators/controllers/solidus_globalize/spree/admin/product_properties_controller_decorator.rb
# frozen_string_literal: true
module SolidusGlobalize
module Spree
module Admin
module ProductPropertiesControllerDecorator
def translate
product_property = ::Spree::ProductProperty.find(params[:id])
product_property.update update_product_property_attribute
redirect_to spree.admin_product_product_properties_path(product_property.product)
end
private
def update_product_property_attribute
params.require(:product_property).permit(permitted_params)
end
def permitted_params
[translations_attributes: [:id, :locale, :value]]
end
::Spree::Admin::ProductPropertiesController.prepend self
end
end
end
end