app/controllers/spree/api/promotions_controller.rb in solidus_api-1.2.3 vs app/controllers/spree/api/promotions_controller.rb in solidus_api-1.3.0.beta1

- old
+ new

@@ -10,17 +10,18 @@ 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 && return + end + + def load_promotion + @promotion = Spree::Promotion.find_by_id(params[:id]) || Spree::Promotion.with_coupon_code(params[:id]) + end end end end