Class: Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
app/models/ability.rb

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.



4
5
6
7
# File 'app/models/ability.rb', line 4

def initialize(user)
  alias_action :update, :destroy, to: :modify
  can :modify, ShoppingCart::OrderItem, order_id: ShoppingCart::Order.current_order(user).id
end