Skip to content

Commit

Permalink
Add #authorization_subject to Promotions controllers
Browse files Browse the repository at this point in the history
The  `authorization_subject` method from `solidus_admin` assumes that
all models are in the `Spree` namespace.

(cherry picked from commit c2ba46a)
  • Loading branch information
mamhoff committed Dec 6, 2024
1 parent bfdf4bb commit 6daf063
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@ def destroy
flash[:notice] = t(".success")
redirect_back_or_to solidus_promotions.promotion_categories_path, status: :see_other
end

private

def authorization_subject
SolidusPromotions::PromotionCategory
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,9 @@ def load_promotion
def promotion_params
params.require(:promotion).permit(:user_id, permitted_promotion_attributes)
end

def authorization_subject
SolidusPromotions::Promotion
end
end
end

0 comments on commit 6daf063

Please sign in to comment.