Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ApplicationController < ActionController::Base
- helper_method :user_ability, :company_ability
- private
- def user_ability
- @user_ability if defined?(@user_ability)
- @user_ability = Ability.new(current_user, @company ||= nil) # company comes from a child controller / nested controller
- end
- end
Add Comment
Please, Sign In to add comment