From a8582cee89b972d9a237777eddf2fb6911419000 Mon Sep 17 00:00:00 2001 From: Eyup Atis Date: Sat, 3 Feb 2018 15:55:30 +0300 Subject: [PATCH] #186 fixes cancan integration presence control fixes #186 --- app/controllers/koudoku/subscriptions_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/koudoku/subscriptions_controller.rb b/app/controllers/koudoku/subscriptions_controller.rb index ebf4dde..88cdae1 100644 --- a/app/controllers/koudoku/subscriptions_controller.rb +++ b/app/controllers/koudoku/subscriptions_controller.rb @@ -53,7 +53,7 @@ def load_subscription @subscription = ::Subscription.where(ownership_attribute => current_owner.id).find_by_id(params[:id]) # also, if cancan methods are available, we should use that to authorize. - if defined?(:can?) + if respond_to?(:can?) return unauthorized unless can? :manage, @subscription end