Class: Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability, PaidUp::Ability
Defined in:
lib/generators/paid_up/install/templates/ability.rb

Overview

CanCanCan Ability class

Instance Method Summary collapse

Methods included from PaidUp::Ability

#initialize_paid_up

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.


8
9
10
11
12
13
14
15
# File 'lib/generators/paid_up/install/templates/ability.rb', line 8

def initialize(user)
  user ||= User.new # anonymous user (not logged in)

  # Rails Application's initialization could go here.
  # can :manage, Group, user: user

  initialize_paid_up(user)
end