Skip to content

Instantly share code, notes, and snippets.

@guich-wo
guich-wo / abilities.rb
Last active March 6, 2017 16:30 — forked from ryanb/abilities.rb
How you can break up large Ability class in CanCan
module Abilities
def self.ability_for(user)
AdminAbility.new(user) if user.admin?
MemberAbility.new(user) if user.member?
# etc...
end
class AdminAbility
include CanCan::Ability