a guest Jul 24th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Abilities
  2.   class MyModel < Base
  3.     def initialize(user)
  4.       super(user)
  5.       return unless user.present?
  6.       can :manage, ::MyModel, my_other_model: { user_id: }
  7.     end
  8.   end
  9. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand