Allow an (optional) post-creation time to be submitted. (#4205)

* Allow an (optional) post-creation time to be submitted.

This should allow a new post to be created with an initial
date/time specified by the caller, which will be useful for
people writing importers..

* Only allow `created_at` to be submitted via the API.

This addresses the previous concern.
This commit is contained in:
Steve Kemp 2016-05-22 11:54:03 +03:00 committed by Régis Hanol
parent c012b18601
commit 8f8ad3fe4a

View File

@ -544,7 +544,7 @@ class PostsController < ApplicationController
:reply_to_post_number,
:auto_track,
:typing_duration_msecs,
:composer_open_duration_msecs
:composer_open_duration_msecs,
]
# param munging for WordPress
@ -557,6 +557,10 @@ class PostsController < ApplicationController
# We allow `embed_url` via the API
permitted << :embed_url
# We allow `created_at` via the API
permitted << :created_at
end
params.require(:raw)