Created
July 4, 2018 16:15
-
-
Save sankalpk/93823ed23d482469f4579a136fff4f9b to your computer and use it in GitHub Desktop.
Convert form to form template in Cloverbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
email = "<INSERT_EMAIL_HERE>" | |
form_graph_id = "<INSERT_GRAPH_ID_HERE" | |
user = User.find_by_email | |
form = Form.find(GraphQL::Schema::UniqueWithinType.decode(form_graph_id)[1]) | |
FormTemplate.create!( | |
user_id: user.id, | |
brand_id: user.primary_brand.id, | |
schema: form.schema, | |
ui_schema: form.ui_schema, | |
title: form.title, | |
description: form.description, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment