Class: TentD::API::Followings::Update

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



113
114
115
116
117
118
119
# File 'lib/tentd/api/followings.rb', line 113

def action(env)
  if following = Model::Following.first(:id => env.params.following_id)
    following.update_from_params(env.params.data, env.authorized_scopes)
    env.response = following
  end
  env
end