Created
July 12, 2019 12:21
-
-
Save sideshowbandana/98e01dcb8e5b6b09a3fa59af64e62374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Abilities | |
class MyModel < Base | |
def initialize(user) | |
super(user) | |
return unless user.present? | |
can :manage, ::MyModel, my_other_model: { user_id: user.id } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment