Class: TentD::API::Followings::Create

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



102
103
104
105
106
107
108
109
# File 'lib/tentd/api/followings.rb', line 102

def action(env)
  if env.following.confirm_from_params(env.follow_data.merge(env.params.data).merge(:profile => env.profile))
    env.response = env.following
    env.notify_action = 'create'
    env.notify_instance = env.following
  end
  env
end