Guest User

Untitled

a guest
Apr 26th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. def add_app(app_id, actor_user = nil)
  2. app = App.find_by_id(app_id)
  3.  
  4. return unless app &&
  5. (app.account_id == role.account_id)
  6.  
  7. old_app_ids = role.grants.map(&:app_id)
  8. update_apps(old_app_ids + [app_id], actor_user)
  9. end
Add Comment
Please, Sign In to add comment