Skip to content

Instantly share code, notes, and snippets.

@sideshowbandana
Created July 12, 2019 12:21
Show Gist options
  • Save sideshowbandana/98e01dcb8e5b6b09a3fa59af64e62374 to your computer and use it in GitHub Desktop.
Save sideshowbandana/98e01dcb8e5b6b09a3fa59af64e62374 to your computer and use it in GitHub Desktop.
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