Class: TentD::API::Followers::Destroy

Inherits:
Middleware
  • Object
show all
Defined in:
lib/tentd/api/followers.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



150
151
152
153
154
155
156
157
# File 'lib/tentd/api/followers.rb', line 150

def action(env)
  if (follower = Model::Follower.first(:id => env.params[:follower_id])) && follower.destroy
    env.notify_action = 'delete'
    env.notify_instance = follower
    env.response = ''
  end
  env
end