app/controllers/cadenero/v1/accounts_controller.rb in cadenero-0.0.2.b4 vs app/controllers/cadenero/v1/accounts_controller.rb in cadenero-0.0.2.b5
- old
+ new
@@ -11,20 +11,18 @@
render json: {errors: errors, links: "/v1/accounts/sign_up"}, status: :unprocessable_entity
end
# Create a [Cadenero::V1::Account] based on the params sended by the client as a JSON with the account inrormation
#
# @example Posting the account data to be created in a subdomain
- # post "http://www.example.com/v1/accounts",
- # account: { name: "Testy", subdomain: "test",
+ # post "http://www.example.com/v1/accounts",
+ # account: { name: "Testy", subdomain: "test",
# owner_attributes: {email: "testy@example.com", password: "changeme", password_confirmation: "changeme"} }
#
- # @return render JSON of [Cadenero::V1::Account] created and the status 201 Created: The request has been
+ # @return render JSON of [Cadenero::V1::Account] created and the status 201 Created: The request has been
# fulfilled and resulted in a new resource being created.
def create
@account = Cadenero::V1::Account.create_with_owner(params[:account])
if @account.valid?
- @account.create_schema
- @account.ensure_authentication_token!
force_authentication!(@account.owner)
render json: @account, status: :created
else
@data = {
errors: @account.errors