Class: TentD::API::Groups::Destroy

Inherits:
Middleware show all
Defined in:
lib/tentd/api/groups.rb

Instance Method Summary collapse

Methods inherited from Middleware

#call, #initialize

Methods included from Authorizable

#authorize_env!, #authorize_env?

Constructor Details

This class inherits a constructor from TentD::API::Middleware

Instance Method Details

#action(env) ⇒ Object



95
96
97
98
99
100
101
102
# File 'lib/tentd/api/groups.rb', line 95

def action(env)
  if (group = Model::Group.first(:id => env.params.group_id)) && group.destroy
    env.response = ''
    env.notify_action = 'delete'
    env.notify_instance = group
  end
  env
end