Module: CanCan::Export::ControllerHelpers

Defined in:
lib/cancan/export/helpers.rb

Instance Method Summary collapse

Instance Method Details

#gonObject



5
6
7
8
9
10
11
12
# File 'lib/cancan/export/helpers.rb', line 5

def gon
  super.tap do |g|
    if current_user
      g.user ||= current_user
      g.ability ||= ::Ability.new(g.user)
    end
  end
end