app/controllers/spree/api/v1/promotions_controller.rb in spree_api-3.3.6 vs app/controllers/spree/api/v1/promotions_controller.rb in spree_api-3.4.0.rc1

- old
+ new

@@ -11,18 +11,19 @@ else raise ActiveRecord::RecordNotFound end end - private - def requires_admin - return if @current_user_roles.include?("admin") - unauthorized and return - end + private - def load_promotion - @promotion = Spree::Promotion.find_by(id: params[:id]) || Spree::Promotion.with_coupon_code(params[:id]) - end + def requires_admin + return if @current_user_roles.include?('admin') + unauthorized and return + end + + def load_promotion + @promotion = Spree::Promotion.find_by(id: params[:id]) || Spree::Promotion.with_coupon_code(params[:id]) + end end end end end