Class: TentD::API::Posts::CreatePost
- Inherits:
-
Middleware
- Object
- Middleware
- TentD::API::Posts::CreatePost
- Defined in:
- lib/tentd/api/posts.rb
Instance Method Summary collapse
Methods inherited from Middleware
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
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/tentd/api/posts.rb', line 118 def action(env) (env) set_app_details(env.params.data) set_publicity(env.params.data) parse_times(env.params.data) data = env.params[:data].slice(*whitelisted_attributes(env)) data.public_id = env.params.data.id if env.params.data.id post = Model::Post.create(data) post.(env.params.data.) if post.original env['response'] = post env end |