Class: Padrino::CanCan::Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
lib/padrino-cancan/helpers.rb

Instance Method Summary collapse

Constructor Details

#initialize(account, registered_abilities) ⇒ Ability

Returns a new instance of Ability.



52
53
54
55
56
57
58
# File 'lib/padrino-cancan/helpers.rb', line 52

def initialize , registered_abilities
  role = .role.to_sym rescue :any

  (registered_abilities[role] || []).each do |cans|
    instance_eval &cans
  end
end