Skip to content

Instantly share code, notes, and snippets.

View stabenfeldt's full-sized avatar
🎯
Focusing

Martin Stabenfeldt stabenfeldt

🎯
Focusing
View GitHub Profile
# app/models/spree/custom_ability.rb
module Spree
class CustomAbility
include CanCan::Ability
def initialize(user)
can [:action], Spree.user_class, id: user.id
end
end
end