Guest User

Untitled

a guest
Jul 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. class ApplicationController < ActionController::Base
  2. helper_method :user_ability, :company_ability
  3.  
  4. private
  5.  
  6. def user_ability
  7. @user_ability if defined?(@user_ability)
  8. @user_ability = Ability.new(current_user, @company ||= nil) # company comes from a child controller / nested controller
  9. end
  10.  
  11. end
Add Comment
Please, Sign In to add comment