+
<%= _('Customizable Templates') %>
<%= paginable_renderise(
partial: 'paginable/templates/funders',
diff --git a/app/views/questions/_show_question.html.erb b/app/views/questions/_show_question.html.erb
index 5e713d5..c67c3bc 100644
--- a/app/views/questions/_show_question.html.erb
+++ b/app/views/questions/_show_question.html.erb
@@ -84,7 +84,7 @@
example_answer: example_answer,
guidance: guidance,
question: question,
- options: { url: admin_update_annotation_path, method: 'PUT' }
+ options: { url: admin_update_annotation_path(r: current_tab), method: 'PUT' }
} %>
<% end %>
diff --git a/db/schema.rb b/db/schema.rb
index 40a8cae..2ca0b37 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -13,452 +13,462 @@
ActiveRecord::Schema.define(version: 20180212124444) do
- # These are extensions that must be enabled in order to support this database
- enable_extension "plpgsql"
-
create_table "annotations", force: :cascade do |t|
- t.integer "question_id"
- t.integer "org_id"
- t.text "text"
- t.integer "type", default: 0, null: false
+ t.integer "question_id", limit: 4
+ t.integer "org_id", limit: 4
+ t.text "text", limit: 65535
+ t.integer "type", limit: 4, default: 0, null: false
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "annotations", ["question_id"], name: "index_annotations_on_question_id", using: :btree
+ add_index "annotations", ["org_id"], name: "fk_rails_aca7521f72"
+ add_index "annotations", ["question_id"], name: "fk_rails_0e08e753b6"
+ add_index "annotations", ["question_id"], name: "index_annotations_on_question_id"
create_table "answers", force: :cascade do |t|
- t.text "text"
- t.integer "plan_id"
- t.integer "user_id"
- t.integer "question_id"
+ t.text "text", limit: 65535
+ t.integer "plan_id", limit: 4
+ t.integer "user_id", limit: 4
+ t.integer "question_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "lock_version", default: 0
+ t.integer "lock_version", limit: 4, default: 0
+ t.string "label_id", limit: 255
end
+ add_index "answers", ["plan_id"], name: "fk_rails_84a6005a3e"
+ add_index "answers", ["question_id"], name: "fk_rails_3d5ed4418f"
+ add_index "answers", ["user_id"], name: "fk_rails_584be190c2"
+
create_table "answers_question_options", id: false, force: :cascade do |t|
- t.integer "answer_id", null: false
- t.integer "question_option_id", null: false
+ t.integer "answer_id", limit: 4, null: false
+ t.integer "question_option_id", limit: 4, null: false
end
- add_index "answers_question_options", ["answer_id"], name: "index_answers_question_options_on_answer_id", using: :btree
+ add_index "answers_question_options", ["answer_id"], name: "index_answers_question_options_on_answer_id"
create_table "exported_plans", force: :cascade do |t|
- t.integer "plan_id"
- t.integer "user_id"
- t.string "format"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.integer "phase_id"
+ t.integer "plan_id", limit: 4
+ t.integer "user_id", limit: 4
+ t.string "format", limit: 255
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "phase_id", limit: 4
end
create_table "file_types", force: :cascade do |t|
- t.string "name"
- t.string "icon_name"
- t.integer "icon_size"
- t.string "icon_location"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "name", limit: 255
+ t.string "icon_name", limit: 255
+ t.integer "icon_size", limit: 4
+ t.string "icon_location", limit: 255
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
create_table "file_uploads", force: :cascade do |t|
- t.string "name"
- t.string "title"
- t.text "description"
- t.integer "size"
+ t.string "name", limit: 255
+ t.string "title", limit: 255
+ t.text "description", limit: 65535
+ t.integer "size", limit: 4
t.boolean "published"
- t.string "location"
- t.integer "file_type_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "location", limit: 255
+ t.integer "file_type_id", limit: 4
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
create_table "friendly_id_slugs", force: :cascade do |t|
- t.string "slug", null: false
- t.integer "sluggable_id", null: false
+ t.string "slug", limit: 255, null: false
+ t.integer "sluggable_id", limit: 4, null: false
t.string "sluggable_type", limit: 40
t.datetime "created_at"
end
- add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", unique: true, using: :btree
- add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree
- add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree
+ add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", unique: true
+ add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
+ add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
create_table "guidance_groups", force: :cascade do |t|
- t.string "name"
- t.integer "org_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "name", limit: 255
+ t.integer "org_id", limit: 4
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.boolean "optional_subset"
t.boolean "published"
end
- add_index "guidance_groups", ["org_id"], name: "index_guidance_groups_on_org_id", using: :btree
+ add_index "guidance_groups", ["org_id"], name: "fk_rails_819c1dbbc7"
+ add_index "guidance_groups", ["org_id"], name: "index_guidance_groups_on_org_id"
create_table "guidances", force: :cascade do |t|
- t.text "text"
- t.integer "guidance_group_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.integer "question_id"
+ t.text "text", limit: 65535
+ t.integer "guidance_group_id", limit: 4
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "question_id", limit: 4
t.boolean "published"
end
- add_index "guidances", ["guidance_group_id"], name: "index_guidances_on_guidance_group_id", using: :btree
+ add_index "guidances", ["guidance_group_id"], name: "fk_rails_20d29da787"
+ add_index "guidances", ["guidance_group_id"], name: "index_guidances_on_guidance_group_id"
create_table "identifier_schemes", force: :cascade do |t|
- t.string "name"
- t.string "description"
+ t.string "name", limit: 255
+ t.string "description", limit: 255
t.boolean "active"
t.datetime "created_at"
t.datetime "updated_at"
- t.text "logo_url"
- t.text "user_landing_url"
+ t.text "logo_url", limit: 255
+ t.text "user_landing_url", limit: 255
end
create_table "languages", force: :cascade do |t|
- t.string "abbreviation"
- t.string "description"
- t.string "name"
+ t.string "abbreviation", limit: 255
+ t.string "description", limit: 255
+ t.string "name", limit: 255
t.boolean "default_language"
end
create_table "notes", force: :cascade do |t|
- t.integer "user_id"
- t.text "text"
+ t.integer "user_id", limit: 4
+ t.text "text", limit: 65535
t.boolean "archived"
- t.integer "answer_id"
- t.integer "archived_by"
+ t.integer "answer_id", limit: 4
+ t.integer "archived_by", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "notes", ["answer_id"], name: "index_notes_on_answer_id", using: :btree
+ add_index "notes", ["answer_id"], name: "fk_rails_907f8d48bf"
+ add_index "notes", ["answer_id"], name: "index_notes_on_answer_id"
+ add_index "notes", ["user_id"], name: "fk_rails_7f2323ad43"
create_table "org_identifiers", force: :cascade do |t|
- t.string "identifier"
- t.string "attrs"
+ t.string "identifier", limit: 255
+ t.string "attrs", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "org_id"
- t.integer "identifier_scheme_id"
+ t.integer "org_id", limit: 4
+ t.integer "identifier_scheme_id", limit: 4
end
+ add_index "org_identifiers", ["identifier_scheme_id"], name: "fk_rails_189ad2e573"
+ add_index "org_identifiers", ["org_id"], name: "fk_rails_36323c0674"
+
create_table "org_token_permissions", force: :cascade do |t|
- t.integer "org_id"
- t.integer "token_permission_type_id"
+ t.integer "org_id", limit: 4
+ t.integer "token_permission_type_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "org_token_permissions", ["org_id"], name: "index_org_token_permissions_on_org_id", using: :btree
+ add_index "org_token_permissions", ["org_id"], name: "fk_rails_e1db1b22c5"
+ add_index "org_token_permissions", ["org_id"], name: "index_org_token_permissions_on_org_id"
+ add_index "org_token_permissions", ["token_permission_type_id"], name: "fk_rails_2aa265f538"
create_table "orgs", force: :cascade do |t|
- t.string "name"
- t.string "abbreviation"
- t.string "target_url"
- t.string "wayfless_entity"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.integer "parent_id"
+ t.string "name", limit: 255
+ t.string "abbreviation", limit: 255
+ t.string "target_url", limit: 255
+ t.string "wayfless_entity", limit: 255
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "parent_id", limit: 4
t.boolean "is_other"
- t.string "sort_name"
- t.text "banner_text"
- t.string "logo_file_name"
- t.integer "region_id"
- t.integer "language_id"
- t.string "logo_uid"
- t.string "logo_name"
- t.string "contact_email"
- t.integer "org_type", default: 0, null: false
- t.text "links", default: "[]"
- t.string "contact_name"
- t.boolean "feedback_enabled", default: false
- t.string "feedback_email_subject"
- t.text "feedback_email_msg"
+ t.string "sort_name", limit: 255
+ t.text "banner_text", limit: 65535
+ t.string "logo_file_name", limit: 255
+ t.integer "region_id", limit: 4
+ t.integer "language_id", limit: 4
+ t.string "logo_uid", limit: 255
+ t.string "logo_name", limit: 255
+ t.string "contact_email", limit: 255
+ t.integer "org_type", limit: 4, default: 0, null: false
+ t.string "contact_name", limit: 255
+ t.text "links", limit: 255, default: "[]"
+ t.boolean "feedback_enabled", default: false
+ t.string "feedback_email_subject", limit: 255
+ t.text "feedback_email_msg", limit: 65535
end
+ add_index "orgs", ["language_id"], name: "fk_rails_5640112cab"
+ add_index "orgs", ["region_id"], name: "fk_rails_5a6adf6bab"
+
create_table "perms", force: :cascade do |t|
- t.string "name"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "name", limit: 255
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
- add_index "perms", ["name"], name: "index_perms_on_name", using: :btree
- add_index "perms", ["name"], name: "index_roles_on_name_and_resource_type_and_resource_id", using: :btree
+ add_index "perms", ["name"], name: "index_perms_on_name"
+ add_index "perms", ["name"], name: "index_roles_on_name_and_resource_type_and_resource_id"
create_table "phases", force: :cascade do |t|
- t.string "title"
- t.text "description"
- t.integer "number"
- t.integer "template_id"
+ t.string "title", limit: 255
+ t.text "description", limit: 65535
+ t.integer "number", limit: 4
+ t.integer "template_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
- t.string "slug"
+ t.string "slug", limit: 255
t.boolean "modifiable"
end
- add_index "phases", ["template_id"], name: "index_phases_on_template_id", using: :btree
+ add_index "phases", ["template_id"], name: "index_phases_on_template_id"
create_table "plans", force: :cascade do |t|
- t.string "title"
- t.integer "template_id"
+ t.string "title", limit: 255
+ t.integer "template_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
- t.string "slug"
- t.string "grant_number"
- t.string "identifier"
- t.text "description"
- t.string "principal_investigator"
- t.string "principal_investigator_identifier"
- t.string "data_contact"
- t.string "funder_name"
- t.integer "visibility", null: false
- t.string "data_contact_email"
- t.string "data_contact_phone"
- t.string "principal_investigator_email"
- t.string "principal_investigator_phone"
- t.boolean "feedback_requested", default: false
- t.boolean "complete", default: false
+ t.string "slug", limit: 255
+ t.string "data_contact_phone", limit: 255
+ t.string "grant_number", limit: 255
+ t.string "identifier", limit: 255
+ t.text "description", limit: 65535
+ t.string "principal_investigator", limit: 255
+ t.string "principal_investigator_identifier", limit: 255
+ t.string "data_contact", limit: 255
+ t.string "funder_name", limit: 255
+ t.integer "visibility", limit: 4, null: false
+ t.string "data_contact_email", limit: 255
+ t.string "principal_investigator_email", limit: 255
+ t.string "principal_investigator_phone", limit: 255
+ t.boolean "feedback_requested", default: false
+ t.boolean "complete", default: false
end
- add_index "plans", ["template_id"], name: "index_plans_on_template_id", using: :btree
+ add_index "plans", ["template_id"], name: "index_plans_on_template_id"
create_table "plans_guidance_groups", force: :cascade do |t|
- t.integer "guidance_group_id"
- t.integer "plan_id"
+ t.integer "guidance_group_id", limit: 4
+ t.integer "plan_id", limit: 4
end
+ add_index "plans_guidance_groups", ["guidance_group_id"], name: "fk_rails_ec1c5524d7"
+ add_index "plans_guidance_groups", ["plan_id"], name: "fk_rails_13d0671430"
+
create_table "prefs", force: :cascade do |t|
- t.text "settings"
- t.integer "user_id"
+ t.text "settings", limit: 65535
+ t.integer "user_id", limit: 4
+ end
+
+ create_table "question_format_labels", id: false, force: :cascade do |t|
+ t.integer "id", limit: 4
+ t.string "description", limit: 255
+ t.integer "question_id", limit: 4
+ t.integer "number", limit: 4
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
create_table "question_formats", force: :cascade do |t|
- t.string "title"
- t.text "description"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.boolean "option_based", default: false
- t.integer "formattype", default: 0
+ t.string "title", limit: 255
+ t.text "description", limit: 65535
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.boolean "option_based", default: false
+ t.integer "formattype", limit: 4, default: 0
end
create_table "question_options", force: :cascade do |t|
- t.integer "question_id"
- t.string "text"
- t.integer "number"
+ t.integer "question_id", limit: 4
+ t.string "text", limit: 255
+ t.integer "number", limit: 4
t.boolean "is_default"
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "question_options", ["question_id"], name: "index_question_options_on_question_id", using: :btree
+ add_index "question_options", ["question_id"], name: "fk_rails_b9c5f61cf9"
+ add_index "question_options", ["question_id"], name: "index_question_options_on_question_id"
create_table "questions", force: :cascade do |t|
- t.text "text"
- t.text "default_value"
- t.integer "number"
- t.integer "section_id"
+ t.text "text", limit: 65535
+ t.text "default_value", limit: 65535
+ t.integer "number", limit: 4
+ t.integer "section_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "question_format_id"
- t.boolean "option_comment_display", default: true
+ t.integer "question_format_id", limit: 4
+ t.boolean "option_comment_display", default: true
t.boolean "modifiable"
end
- add_index "questions", ["section_id"], name: "index_questions_on_section_id", using: :btree
+ add_index "questions", ["question_format_id"], name: "fk_rails_4fbc38c8c7"
+ add_index "questions", ["section_id"], name: "index_questions_on_section_id"
create_table "questions_themes", id: false, force: :cascade do |t|
- t.integer "question_id", null: false
- t.integer "theme_id", null: false
+ t.integer "question_id", limit: 4, null: false
+ t.integer "theme_id", limit: 4, null: false
end
- add_index "questions_themes", ["question_id"], name: "index_questions_themes_on_question_id", using: :btree
+ add_index "questions_themes", ["question_id"], name: "index_questions_themes_on_question_id"
create_table "regions", force: :cascade do |t|
- t.string "abbreviation"
- t.string "description"
- t.string "name"
- t.integer "super_region_id"
+ t.string "abbreviation", limit: 255
+ t.string "description", limit: 255
+ t.string "name", limit: 255
+ t.integer "super_region_id", limit: 4
end
create_table "roles", force: :cascade do |t|
- t.integer "user_id"
- t.integer "plan_id"
+ t.integer "user_id", limit: 4
+ t.integer "plan_id", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "access", default: 0, null: false
- t.boolean "active", default: true
+ t.integer "access", limit: 4, default: 0, null: false
+ t.boolean "active", default: true
end
- add_index "roles", ["plan_id"], name: "index_roles_on_plan_id", using: :btree
- add_index "roles", ["user_id"], name: "index_roles_on_user_id", using: :btree
+ add_index "roles", ["plan_id"], name: "fk_rails_a1ce6c2772"
+ add_index "roles", ["plan_id"], name: "index_roles_on_plan_id"
+ add_index "roles", ["user_id"], name: "fk_rails_ab35d699f0"
+ add_index "roles", ["user_id"], name: "index_roles_on_user_id"
+
+ create_table "sample_plans", id: false, force: :cascade do |t|
+ t.integer "id", limit: 4
+ t.string "url", limit: 255
+ t.string "label", limit: 255
+ t.integer "template_id", limit: 4
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
create_table "sections", force: :cascade do |t|
- t.string "title"
- t.text "description"
- t.integer "number"
+ t.string "title", limit: 255
+ t.text "description", limit: 65535
+ t.integer "number", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "published"
- t.integer "phase_id"
+ t.integer "phase_id", limit: 4
t.boolean "modifiable"
end
- add_index "sections", ["phase_id"], name: "index_sections_on_phase_id", using: :btree
+ add_index "sections", ["phase_id"], name: "index_sections_on_phase_id"
create_table "settings", force: :cascade do |t|
- t.string "var", null: false
- t.text "value"
- t.integer "target_id", null: false
- t.string "target_type", null: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "var", limit: 255, null: false
+ t.text "value", limit: 65535
+ t.integer "target_id", limit: 4, null: false
+ t.string "target_type", limit: 255, null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
- add_index "settings", ["target_type", "target_id", "var"], name: "index_settings_on_target_type_and_target_id_and_var", unique: true, using: :btree
+ add_index "settings", ["target_type", "target_id", "var"], name: "index_settings_on_target_type_and_target_id_and_var", unique: true
create_table "splash_logs", force: :cascade do |t|
- t.string "destination"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "destination", limit: 255
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
create_table "templates", force: :cascade do |t|
- t.string "title"
- t.text "description"
+ t.string "title", limit: 255
+ t.text "description", limit: 65535
t.boolean "published"
- t.integer "org_id"
- t.string "locale"
+ t.integer "org_id", limit: 4
+ t.string "locale", limit: 255
t.boolean "is_default"
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "version"
- t.integer "visibility"
- t.integer "customization_of"
- t.integer "dmptemplate_id"
+ t.integer "version", limit: 4
+ t.integer "visibility", limit: 4
+ t.integer "customization_of", limit: 4
+ t.integer "dmptemplate_id", limit: 4
t.boolean "migrated"
- t.boolean "dirty", default: false
- t.text "links", default: "{\"funder\":[], \"sample_plan\":[]}"
+ t.boolean "dirty", default: false
+ t.text "links", limit: 255, default: "{\"funder\":[], \"sample_plan\":[]}"
end
- add_index "templates", ["org_id", "dmptemplate_id"], name: "template_organisation_dmptemplate_index", using: :btree
- add_index "templates", ["org_id"], name: "index_templates_on_org_id", using: :btree
+ add_index "templates", ["org_id", "dmptemplate_id"], name: "template_organisation_dmptemplate_index"
+ add_index "templates", ["org_id"], name: "index_templates_on_org_id"
create_table "themes", force: :cascade do |t|
- t.string "title"
- t.text "description"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.string "locale"
+ t.string "title", limit: 255
+ t.text "description", limit: 65535
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "locale", limit: 255
end
create_table "themes_in_guidance", id: false, force: :cascade do |t|
- t.integer "theme_id"
- t.integer "guidance_id"
+ t.integer "theme_id", limit: 4
+ t.integer "guidance_id", limit: 4
end
- add_index "themes_in_guidance", ["guidance_id"], name: "index_themes_in_guidance_on_guidance_id", using: :btree
- add_index "themes_in_guidance", ["theme_id"], name: "index_themes_in_guidance_on_theme_id", using: :btree
+ add_index "themes_in_guidance", ["guidance_id"], name: "fk_rails_a5ab9402df"
+ add_index "themes_in_guidance", ["guidance_id"], name: "index_themes_in_guidance_on_guidance_id"
+ add_index "themes_in_guidance", ["theme_id"], name: "fk_rails_7d708f6f1e"
+ add_index "themes_in_guidance", ["theme_id"], name: "index_themes_in_guidance_on_theme_id"
create_table "token_permission_types", force: :cascade do |t|
- t.string "token_type"
- t.text "text_description"
+ t.string "token_type", limit: 255
+ t.text "text_description", limit: 65535
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "user_identifiers", force: :cascade do |t|
- t.string "identifier"
+ t.string "identifier", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "user_id"
- t.integer "identifier_scheme_id"
+ t.integer "user_id", limit: 4
+ t.integer "identifier_scheme_id", limit: 4
end
- add_index "user_identifiers", ["user_id"], name: "index_user_identifiers_on_user_id", using: :btree
+ add_index "user_identifiers", ["identifier_scheme_id"], name: "fk_rails_fe95df7db0"
+ add_index "user_identifiers", ["user_id"], name: "fk_rails_65c9a98cdb"
+ add_index "user_identifiers", ["user_id"], name: "index_user_identifiers_on_user_id"
create_table "users", force: :cascade do |t|
- t.string "firstname"
- t.string "surname"
- t.string "email", default: "", null: false
- t.string "orcid_id"
- t.string "shibboleth_id"
+ t.string "firstname", limit: 255
+ t.string "surname", limit: 255
+ t.string "email", limit: 255, default: "", null: false
+ t.string "orcid_id", limit: 255
+ t.string "shibboleth_id", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
- t.string "encrypted_password", default: ""
- t.string "reset_password_token"
+ t.string "encrypted_password", limit: 255, default: ""
+ t.string "reset_password_token", limit: 255
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
- t.integer "sign_in_count", default: 0
+ t.integer "sign_in_count", limit: 4, default: 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
- t.string "current_sign_in_ip"
- t.string "last_sign_in_ip"
- t.string "confirmation_token"
+ t.string "current_sign_in_ip", limit: 255
+ t.string "last_sign_in_ip", limit: 255
+ t.string "confirmation_token", limit: 255
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
- t.string "invitation_token"
+ t.string "invitation_token", limit: 255
t.datetime "invitation_created_at"
t.datetime "invitation_sent_at"
t.datetime "invitation_accepted_at"
- t.string "other_organisation"
+ t.string "other_organisation", limit: 255
t.boolean "accept_terms"
- t.integer "org_id"
- t.string "api_token"
- t.integer "invited_by_id"
- t.string "invited_by_type"
- t.integer "language_id"
- t.string "recovery_email"
+ t.integer "org_id", limit: 4
+ t.string "api_token", limit: 255
+ t.integer "invited_by_id", limit: 4
+ t.string "invited_by_type", limit: 255
+ t.integer "language_id", limit: 4
+ t.string "recovery_email", limit: 255
end
- add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
- add_index "users", ["org_id"], name: "index_users_on_org_id", using: :btree
+ add_index "users", ["email"], name: "index_users_on_email", unique: true
+ add_index "users", ["language_id"], name: "fk_rails_45f4f12508"
+ add_index "users", ["org_id"], name: "fk_rails_e73753bccb"
+ add_index "users", ["org_id"], name: "index_users_on_org_id"
create_table "users_perms", id: false, force: :cascade do |t|
- t.integer "user_id"
- t.integer "perm_id"
+ t.integer "user_id", limit: 4
+ t.integer "perm_id", limit: 4
end
- add_index "users_perms", ["user_id"], name: "index_users_perms_on_user_id", using: :btree
+ add_index "users_perms", ["perm_id"], name: "fk_rails_457217c31c"
+ add_index "users_perms", ["user_id"], name: "index_users_perms_on_user_id"
- add_foreign_key "annotations", "orgs"
- add_foreign_key "annotations", "questions"
- add_foreign_key "answers", "plans"
- add_foreign_key "answers", "questions"
- add_foreign_key "answers", "users"
- add_foreign_key "answers_question_options", "answers"
- add_foreign_key "answers_question_options", "question_options"
- add_foreign_key "guidance_groups", "orgs"
- add_foreign_key "guidances", "guidance_groups"
- add_foreign_key "notes", "answers"
- add_foreign_key "notes", "users"
- add_foreign_key "org_identifiers", "identifier_schemes"
- add_foreign_key "org_identifiers", "orgs"
- add_foreign_key "org_token_permissions", "orgs"
- add_foreign_key "org_token_permissions", "token_permission_types"
- add_foreign_key "orgs", "languages"
- add_foreign_key "orgs", "regions"
- add_foreign_key "phases", "templates"
- add_foreign_key "plans", "templates"
- add_foreign_key "plans_guidance_groups", "guidance_groups"
- add_foreign_key "plans_guidance_groups", "plans"
- add_foreign_key "question_options", "questions"
- add_foreign_key "questions", "question_formats"
- add_foreign_key "questions", "sections"
- add_foreign_key "questions_themes", "questions"
- add_foreign_key "questions_themes", "themes"
- add_foreign_key "roles", "plans"
- add_foreign_key "roles", "users"
- add_foreign_key "sections", "phases"
- add_foreign_key "templates", "orgs"
- add_foreign_key "themes_in_guidance", "guidances"
- add_foreign_key "themes_in_guidance", "themes"
- add_foreign_key "user_identifiers", "identifier_schemes"
- add_foreign_key "user_identifiers", "users"
- add_foreign_key "users", "languages"
- add_foreign_key "users", "orgs"
- add_foreign_key "users_perms", "perms"
- add_foreign_key "users_perms", "users"
end
diff --git a/test/functional/annotations_controller_test.rb b/test/functional/annotations_controller_test.rb
index 1a02d74..f8ea039 100644
--- a/test/functional/annotations_controller_test.rb
+++ b/test/functional/annotations_controller_test.rb
@@ -30,7 +30,7 @@
sign_in @user
put admin_update_annotation_path(id: @question.section.phase.id), @create_hash
assert_response :redirect
- assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}"
+ assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}&r=all-templates"
assert flash[:notice].start_with?('Successfully') && flash[:notice].include?('example answer') && flash[:notice].include?('guidance')
assert_equal 'New example', Annotation.find_by(@example_answer_qry).text, "expected example answer to have been created."
assert_equal 'New guidance', Annotation.find_by(@guidance_qry).text, "expected guidance to have been created."
@@ -40,7 +40,7 @@
put admin_update_annotation_path(id: @question.section.phase.id), {question_id: @question.id, example_answer_text: "New example"}
assert flash[:notice].start_with?('Successfully') && flash[:notice].include?('updated')
assert_response :redirect
- assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}"
+ assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}&r=all-templates"
assert_equal 'New example', Annotation.find_by(@example_answer_qry).text, "expected example answer to have been created."
assert Annotation.find_by(@guidance_qry).nil?, "expected no guidance to have been created."
end
@@ -49,7 +49,7 @@
put admin_update_annotation_path(id: @question.section.phase.id), {question_id: @question.id, guidance_text: "New guidance"}
assert flash[:notice].start_with?('Successfully') && flash[:notice].include?('updated')
assert_response :redirect
- assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}"
+ assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}&r=all-templates"
assert Annotation.find_by(@example_answer_qry).nil?, "expected no example answer to have been created."
assert_equal 'New guidance', Annotation.find_by(@guidance_qry).text, "expected guidance to have been created."
end
@@ -60,7 +60,7 @@
put admin_update_annotation_path(id: @question.section.phase.id), {question_id: @question.id, example_answer_text: "Updated example", guidance_text: "Updated guidance"}
assert flash[:notice].start_with?('Successfully') && flash[:notice].include?('updated')
assert_response :redirect
- assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}"
+ assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}&r=all-templates"
assert_equal 'Updated example', Annotation.find_by(@example_answer_qry).text, "expected example answer to have been updated."
assert_equal 'Updated guidance', Annotation.find_by(@guidance_qry).text, "expected guidance to have been updated."
end
@@ -70,7 +70,7 @@
put admin_update_annotation_path(id: @question.section.phase.id), {question_id: @question.id, guidance_text: "Updated guidance"}
assert flash[:notice].start_with?('Successfully') && flash[:notice].include?('updated')
assert_response :redirect
- assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}"
+ assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}&r=all-templates"
assert Annotation.find_by(@example_answer_qry).nil?, "expected example answer to have been removed."
assert_equal 'Updated guidance', Annotation.find_by(@guidance_qry).text, "expected guidance to have been updated."
end
@@ -80,7 +80,7 @@
put admin_update_annotation_path(id: @question.section.phase.id), {question_id: @question.id, example_answer_text: "Updated example"}
assert flash[:notice].start_with?('Successfully') && flash[:notice].include?('updated')
assert_response :redirect
- assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}"
+ assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}&r=all-templates"
assert_equal 'Updated example', Annotation.find_by(@example_answer_qry).text, "expected example answer to have been updated."
assert Annotation.find_by(@guidance_qry).nil?, "expected guidance to have been removed."
end
@@ -91,7 +91,7 @@
delete admin_destroy_annotation_path(Annotation.find_by(@example_answer_qry))
assert flash[:notice].start_with?('Successfully') && flash[:notice].include?('deleted')
assert_response :redirect
- assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}"
+ assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?section_id=#{@question.section.id}&r=all-templates"
assert Annotation.find_by(@example_answer_qry).nil?
assert_equal 'New guidance', Annotation.find_by(@guidance_qry).text, "expected guidance to have been unchanged."
end