diff options
Diffstat (limited to 'lib/solidus_subscriptions/permission_sets')
-rw-r--r-- | lib/solidus_subscriptions/permission_sets/default_customer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/solidus_subscriptions/permission_sets/default_customer.rb b/lib/solidus_subscriptions/permission_sets/default_customer.rb index 156a5e1..df9845e 100644 --- a/lib/solidus_subscriptions/permission_sets/default_customer.rb +++ b/lib/solidus_subscriptions/permission_sets/default_customer.rb @@ -4,7 +4,7 @@ module SolidusSubscriptions module PermissionSets class DefaultCustomer < ::Spree::PermissionSets::Base def activate! - can :manage, Subscription, Subscription.where(user: user) do |subscription, guest_token| + can :manage, Subscription, ['user_id = ?', user.id] do |subscription, guest_token| (subscription.guest_token.present? && subscription.guest_token == guest_token) || (subscription.user && subscription.user == user) end |