fe 0.0.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +16 -36
  3. data/app/assets/javascripts/fe/admin.js +0 -1
  4. data/app/assets/javascripts/fe/fe.admin.js +40 -16
  5. data/app/assets/javascripts/fe/fe.common.js +48 -14
  6. data/app/assets/javascripts/fe/fe.public.js +1 -414
  7. data/app/assets/javascripts/fe/fe.public.nojquery.js +450 -0
  8. data/app/assets/javascripts/fe/jquery.validate.pack.js +3 -15
  9. data/app/assets/stylesheets/360front.css +0 -0
  10. data/app/assets/stylesheets/fe/fe.screen.css.scss.erb +69 -10
  11. data/app/controllers/fe/admin/elements_controller.rb +64 -48
  12. data/app/controllers/fe/admin/email_templates_controller.rb +2 -2
  13. data/app/controllers/fe/admin/question_pages_controller.rb +1 -1
  14. data/app/controllers/fe/admin/question_sheets_controller.rb +2 -103
  15. data/app/controllers/fe/concerns/admin/question_sheets_controller_concern.rb +112 -0
  16. data/app/controllers/fe/concerns/answer_pages_controller_concern.rb +2 -1
  17. data/app/controllers/fe/concerns/answer_sheets_controller_concern.rb +1 -1
  18. data/app/controllers/fe/concerns/application_controller_concern.rb +13 -0
  19. data/app/controllers/fe/reference_sheets_controller.rb +2 -0
  20. data/app/controllers/fe/references_controller.rb +1 -0
  21. data/app/helpers/fe/application_helper.rb +5 -0
  22. data/app/mailers/fe/notifier.rb +11 -4
  23. data/app/models/answer_sheet.rb +2 -0
  24. data/app/models/fe/application.rb +2 -1
  25. data/app/models/fe/concerns/answer_pages_presenter_concern.rb +10 -1
  26. data/app/models/fe/concerns/answer_sheet_concern.rb +38 -8
  27. data/app/models/fe/concerns/choice_field_concern.rb +17 -10
  28. data/app/models/fe/date_field.rb +1 -1
  29. data/app/models/fe/element.rb +105 -31
  30. data/app/models/fe/page.rb +52 -20
  31. data/app/models/fe/page_element.rb +6 -1
  32. data/app/models/fe/page_link.rb +6 -3
  33. data/app/models/fe/person.rb +11 -8
  34. data/app/models/fe/question.rb +2 -6
  35. data/app/models/fe/question_grid.rb +1 -1
  36. data/app/models/fe/question_grid_with_total.rb +15 -0
  37. data/app/models/fe/question_set.rb +1 -1
  38. data/app/models/fe/question_sheet.rb +15 -13
  39. data/app/models/fe/reference_question.rb +0 -10
  40. data/app/models/fe/reference_sheet.rb +17 -13
  41. data/app/models/staff.rb +2 -0
  42. data/app/validators/email_validator.rb +11 -0
  43. data/app/views/fe/admin/elements/create.js.erb +1 -0
  44. data/app/views/fe/admin/elements/drop.js.erb +1 -0
  45. data/app/views/fe/admin/elements/duplicate.js.erb +1 -0
  46. data/app/views/fe/admin/panels/_advanced_options.html.erb +9 -3
  47. data/app/views/fe/admin/panels/_common_fields.html.erb +19 -5
  48. data/app/views/fe/admin/panels/_page.html.erb +1 -1
  49. data/app/views/fe/admin/panels/_prop_choice_field.html.erb +20 -11
  50. data/app/views/fe/admin/panels/_prop_element.html.erb +2 -9
  51. data/app/views/fe/admin/panels/_prop_page.html.erb +8 -3
  52. data/app/views/fe/admin/panels/_prop_paragraph.html.erb +38 -24
  53. data/app/views/fe/admin/panels/_prop_section.html.erb +8 -2
  54. data/app/views/fe/admin/panels/_prop_sheet.html.erb +4 -1
  55. data/app/views/fe/admin/question_pages/_element.html.erb +11 -1
  56. data/app/views/fe/answer_pages/_answer_page.html.erb +9 -8
  57. data/app/views/fe/answer_pages/_element.html.erb +6 -7
  58. data/app/views/fe/answer_pages/_page_name.html.erb +1 -0
  59. data/app/views/fe/answer_pages/update.js.erb +3 -3
  60. data/app/views/fe/answer_sheets/_answer_sheet.html.erb +3 -3
  61. data/app/views/fe/answer_sheets/_element.html.erb +52 -34
  62. data/app/views/fe/answer_sheets/_incomplete.html.erb +1 -1
  63. data/app/views/fe/answer_sheets/_page_link.html.erb +2 -2
  64. data/app/views/fe/answer_sheets/_pages_list.html.erb +3 -3
  65. data/app/views/fe/answer_sheets/_submit_to.html.erb +1 -0
  66. data/app/views/fe/answer_sheets/edit.html.erb +14 -14
  67. data/app/views/fe/answer_sheets/incomplete.js.erb +3 -0
  68. data/app/views/fe/answer_sheets/index.html.erb +3 -3
  69. data/app/views/fe/answer_sheets/show.html.erb +1 -1
  70. data/app/views/fe/applications/_logout.html.erb +1 -0
  71. data/app/views/fe/applications/show.html.erb +1 -0
  72. data/app/views/fe/questions/fe/_acceptance.html.erb +3 -3
  73. data/app/views/fe/questions/fe/_attachment_field.html.erb +7 -3
  74. data/app/views/fe/questions/fe/_checkbox_field.html.erb +26 -24
  75. data/app/views/fe/questions/fe/_date_field.html.erb +1 -2
  76. data/app/views/fe/questions/fe/_date_field_mmyy.html.erb +2 -2
  77. data/app/views/fe/questions/fe/_drop_down_field.html.erb +3 -2
  78. data/app/views/fe/questions/fe/_paragraph.html.erb +1 -1
  79. data/app/views/fe/questions/fe/_question_grid.html.erb +14 -9
  80. data/app/views/fe/questions/fe/_question_grid_with_total.html.erb +21 -14
  81. data/app/views/fe/questions/fe/_questions.html.erb +2 -2
  82. data/app/views/fe/questions/fe/_radio_button_field.html.erb +12 -11
  83. data/app/views/fe/questions/fe/_rating.html.erb +9 -8
  84. data/app/views/fe/questions/fe/_reference_discipler.html.erb +1 -1
  85. data/app/views/fe/questions/fe/_reference_friend.html.erb +1 -1
  86. data/app/views/fe/questions/fe/_reference_parent.html.erb +1 -1
  87. data/app/views/fe/questions/fe/_reference_peer.html.erb +1 -1
  88. data/app/views/fe/questions/fe/_reference_question.html.erb +22 -15
  89. data/app/views/fe/questions/fe/_reference_roommate.html.erb +1 -1
  90. data/app/views/fe/questions/fe/_reference_spiritual.html.erb +1 -1
  91. data/app/views/fe/questions/fe/_reference_staff.html.erb +1 -1
  92. data/app/views/fe/questions/fe/_section.html.erb +1 -1
  93. data/app/views/fe/questions/fe/_text_area_field.html.erb +10 -3
  94. data/app/views/fe/questions/fe/_text_field.html.erb +1 -1
  95. data/app/views/fe/questions/fe/_yes_no_field.erb +3 -3
  96. data/app/views/fe/reference_pages/_reference.html.erb +11 -11
  97. data/app/views/fe/reference_pages/edit.html.erb +7 -7
  98. data/app/views/fe/reference_sheets/done.html.erb +2 -2
  99. data/app/views/fe/reference_sheets/not_found.html.erb +4 -4
  100. data/app/views/fe/references/edit.html.erb +6 -6
  101. data/app/views/fe/references/show.html.erb +7 -7
  102. data/app/views/fe/references/submit.js.erb +1 -1
  103. data/app/views/fe/submit_pages/_thankyou.html.erb +1 -1
  104. data/app/views/fe/submit_pages/edit.html.erb +9 -9
  105. data/app/views/layouts/fe/_error_messages_for.html.erb +7 -0
  106. data/app/views/layouts/fe/application.html.erb +1 -1
  107. data/config/routes.rb +0 -36
  108. data/db/migrate/20131003044250_create_reference_sheets.rb +1 -0
  109. data/db/migrate/20140623153424_create_fe_people.rb +1 -1
  110. data/db/migrate/20140624180246_create_fe_addresses.rb +1 -1
  111. data/db/migrate/20140624182216_create_fe_phone_numbers.rb +16 -0
  112. data/db/migrate/20140625160545_create_fe_users.rb +1 -1
  113. data/db/migrate/20150504221439_add_all_element_ids_to_pages.rb +5 -0
  114. data/db/migrate/20150713022326_add_locale_columns.rb +9 -0
  115. data/db/migrate/20150714220730_add_locale_to_answer_sheet.rb +5 -0
  116. data/db/migrate/20150928085325_change_pages_all_element_ids_to_text.rb +5 -0
  117. data/db/migrate/20150930191538_add_locale_to_reference_sheets.rb +5 -0
  118. data/lib/access_key_generator.rb +12 -0
  119. data/lib/distinct_distinct_patch.rb +20 -0
  120. data/lib/fe.rb +4 -0
  121. data/lib/fe/engine.rb +16 -4
  122. data/lib/fe/version.rb +1 -1
  123. data/spec/controllers/fe/admin/elements_controller_spec.rb +201 -1
  124. data/spec/controllers/fe/admin/email_templates_controller_spec.rb +26 -1
  125. data/spec/controllers/fe/admin/question_pages_controller_spec.rb +8 -1
  126. data/spec/controllers/fe/admin/question_sheets_controller_spec.rb +48 -1
  127. data/spec/controllers/fe/answer_pages_controller_spec.rb +73 -1
  128. data/spec/controllers/fe/answer_sheets_controller_spec.rb +80 -1
  129. data/spec/controllers/fe/reference_pages_controller.rb +4 -0
  130. data/spec/controllers/fe/references_controller_spec.rb +4 -0
  131. data/spec/controllers/fe/submit_pages_controller_spec.rb +4 -0
  132. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  133. data/spec/dummy/app/helpers/application_helper.rb +9 -0
  134. data/spec/dummy/app/models/application.rb +3 -0
  135. data/spec/dummy/app/models/person.rb +11 -0
  136. data/spec/dummy/app/models/user.rb +3 -0
  137. data/spec/dummy/config/application.rb +2 -1
  138. data/spec/dummy/config/database.yml +20 -17
  139. data/spec/dummy/config/environments/production.rb +1 -5
  140. data/spec/dummy/config/environments/test.rb +3 -1
  141. data/spec/dummy/config/initializers/fast_gettext.rb +5 -0
  142. data/spec/dummy/config/secrets.yml +2 -2
  143. data/spec/dummy/db/migrate/20141203214017_core.fe_engine.rb +92 -0
  144. data/spec/dummy/db/migrate/20141203214018_create_reference_sheets.fe_engine.rb +25 -0
  145. data/spec/dummy/db/migrate/20141203214019_add_element_and_answer_fields.fe_engine.rb +11 -0
  146. data/spec/dummy/db/migrate/20141203214020_create_email_templates.fe_engine.rb +18 -0
  147. data/spec/dummy/db/migrate/20141203214021_add_max_lengths.fe_engine.rb +9 -0
  148. data/spec/dummy/db/migrate/20141203214022_create_join_table.fe_engine.rb +12 -0
  149. data/spec/dummy/db/migrate/20141203214023_remove_question_id_from_element.fe_engine.rb +10 -0
  150. data/spec/dummy/db/migrate/20141203214024_create_fe_people.fe_engine.rb +13 -0
  151. data/spec/dummy/db/migrate/20141203214025_create_fe_addresses.fe_engine.rb +21 -0
  152. data/{db/migrate/20140624182216_create_create_fe_phone_numbers.rb → spec/dummy/db/migrate/20141203214026_create_create_fe_phone_numbers.fe_engine.rb} +1 -0
  153. data/spec/dummy/db/migrate/20141203214027_create_fe_users.fe_engine.rb +13 -0
  154. data/spec/dummy/db/migrate/20141203214028_add_conditional_type_to_elements.fe_engine.rb +6 -0
  155. data/spec/dummy/db/migrate/20141203214029_add_conditional_answer_to_elements.fe_engine.rb +6 -0
  156. data/spec/dummy/db/migrate/20141203214030_remove_short_value_column.fe_engine.rb +6 -0
  157. data/spec/dummy/db/migrate/20141203214031_move_conditional_ids_used_for_choice_field_to_their_own_column.fe_engine.rb +8 -0
  158. data/spec/dummy/db/migrate/20150123215803_create_users.rb +9 -0
  159. data/spec/dummy/db/migrate/20150504222619_add_all_element_ids_to_pages.fe_engine.rb +6 -0
  160. data/spec/dummy/db/migrate/20150930190001_create_fe_phone_numbers.fe_engine.rb +20 -0
  161. data/spec/dummy/db/migrate/20150930190002_add_locale_columns.fe_engine.rb +10 -0
  162. data/spec/dummy/db/migrate/20150930190003_add_locale_to_answer_sheet.fe_engine.rb +6 -0
  163. data/spec/dummy/db/migrate/20150930190004_change_pages_all_element_ids_to_text.fe_engine.rb +6 -0
  164. data/spec/dummy/db/migrate/20150930191756_add_locale_to_reference_sheets.fe_engine.rb +6 -0
  165. data/spec/dummy/db/schema.rb +50 -20
  166. data/spec/dummy/log/development.log +5 -0
  167. data/spec/factories/applications.rb +0 -1
  168. data/spec/factories/dummy_applications.rb +6 -0
  169. data/spec/factories/dummy_people.rb +6 -0
  170. data/spec/factories/dummy_users.rb +6 -0
  171. data/spec/factories/elements.rb +28 -3
  172. data/spec/factories/email_templates.rb +5 -0
  173. data/spec/factories/fe_email_templates.rb +9 -0
  174. data/spec/factories/fe_people.rb +0 -2
  175. data/spec/factories/fe_user.rb +6 -0
  176. data/spec/factories/question_sheet.rb +1 -1
  177. data/spec/factories/reference_sheets.rb +9 -0
  178. data/spec/mailers/fe/notifier_spec.rb +39 -0
  179. data/spec/models/fe/choice_field_spec.rb +20 -0
  180. data/spec/models/fe/element_spec.rb +185 -0
  181. data/spec/models/fe/page_spec.rb +112 -0
  182. data/spec/models/fe/question_sheet_spec.rb +106 -0
  183. data/spec/models/fe/reference_sheet_spec.rb +20 -0
  184. data/spec/rails_helper.rb +41 -13
  185. data/spec/support/choices.xml +6 -0
  186. metadata +136 -48
  187. data/app/assets/javascripts/fe/rails.extra.js +0 -6
  188. data/app/controllers/fe/applications_controller.rb +0 -183
  189. data/app/controllers/fe/payments_controller.rb +0 -184
  190. data/app/models/fe/payment.rb +0 -77
  191. data/app/models/fe/payment_question.rb +0 -22
  192. data/app/views/fe/admin/panels/_prop_payment_question.html.erb +0 -1
  193. data/app/views/fe/application/_logout.html.erb +0 -1
  194. data/app/views/fe/payment_pages/_credit.html.erb +0 -47
  195. data/app/views/fe/payment_pages/_mail.html.erb +0 -27
  196. data/app/views/fe/payment_pages/_payment.html.erb +0 -6
  197. data/app/views/fe/payment_pages/_staff.html.erb +0 -25
  198. data/app/views/fe/payment_pages/_staff_results.html.erb +0 -17
  199. data/app/views/fe/payment_pages/edit.html.erb +0 -75
  200. data/app/views/fe/payment_pages/staff_search.js.erb +0 -2
  201. data/app/views/fe/payments/_credit.html.erb +0 -47
  202. data/app/views/fe/payments/_errors.html.erb +0 -1
  203. data/app/views/fe/payments/_payment.html.erb +0 -13
  204. data/app/views/fe/payments/_staff.html.erb +0 -21
  205. data/app/views/fe/payments/_staff_results.html.erb +0 -18
  206. data/app/views/fe/payments/approve.js.erb +0 -3
  207. data/app/views/fe/payments/create.js.erb +0 -19
  208. data/app/views/fe/payments/destroy.js.erb +0 -7
  209. data/app/views/fe/payments/edit.html.erb +0 -56
  210. data/app/views/fe/payments/error.js.erb +0 -3
  211. data/app/views/fe/payments/no_access.html.erb +0 -7
  212. data/app/views/fe/payments/staff_search.js.erb +0 -1
  213. data/app/views/fe/payments/update.html.erb +0 -24
  214. data/app/views/fe/questions/fe/_payment_question.html.erb +0 -70
  215. data/db/migrate/20140828045339_create_payments.rb +0 -13
  216. data/spec/dummy/db/test.sqlite3 +0 -0
  217. data/spec/factories/payments.rb +0 -7
  218. data/spec/models/fe/payment_question_spec.rb +0 -65
@@ -0,0 +1,13 @@
1
+ # This migration comes from fe_engine (originally 20140623153424)
2
+ class CreateFePeople < ActiveRecord::Migration
3
+ def change
4
+ create_table :fe_people do |t|
5
+ t.string :first_name, limit: 50
6
+ t.string :last_name, limit: 50
7
+ t.integer :user_id
8
+ t.boolean :is_staff
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ # This migration comes from fe_engine (originally 20140624180246)
2
+ class CreateFeAddresses < ActiveRecord::Migration
3
+ def change
4
+ create_table :fe_addresses do |t|
5
+ t.datetime :startdate
6
+ t.datetime :enddate
7
+ t.string :address1
8
+ t.string :address2
9
+ t.string :address3
10
+ t.string :address4
11
+ t.string :address_type
12
+ t.string :city
13
+ t.string :state
14
+ t.string :zip
15
+ t.string :country
16
+ t.integer :person_id
17
+
18
+ t.timestamps
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,4 @@
1
+ # This migration comes from fe_engine (originally 20140624182216)
1
2
  class CreateCreateFePhoneNumbers < ActiveRecord::Migration
2
3
  def change
3
4
  create_table :create_fe_phone_numbers do |t|
@@ -0,0 +1,13 @@
1
+ # This migration comes from fe_engine (originally 20140625160545)
2
+ class CreateFeUsers < ActiveRecord::Migration
3
+ def change
4
+ create_table :fe_users do |t|
5
+ t.integer :user_id
6
+ t.datetime :last_login
7
+ t.string :type
8
+ t.string :role
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from fe_engine (originally 20140808202507)
2
+ class AddConditionalTypeToElements < ActiveRecord::Migration
3
+ def change
4
+ add_column Fe::Element.table_name, :conditional_type, :string
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from fe_engine (originally 20140808203609)
2
+ class AddConditionalAnswerToElements < ActiveRecord::Migration
3
+ def change
4
+ add_column Fe::Element.table_name, :conditional_answer, :text
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from fe_engine (originally 20141103204704)
2
+ class RemoveShortValueColumn < ActiveRecord::Migration
3
+ def change
4
+ remove_column Fe::Answer.table_name, :short_value
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from fe_engine (originally 20141109154522)
2
+ class MoveConditionalIdsUsedForChoiceFieldToTheirOwnColumn < ActiveRecord::Migration
3
+ def change
4
+ add_column Fe::Element.table_name, :choice_field_id, :integer
5
+ Fe::Element.reset_column_information
6
+ Fe::Element.where(conditional_type: nil).where("conditional_id is not null").update_all("choice_field_id = conditional_id, conditional_id = null")
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :username
5
+ t.string :email
6
+ t.integer :person_id
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from fe_engine (originally 20150504221439)
2
+ class AddAllElementIdsToPages < ActiveRecord::Migration
3
+ def change
4
+ add_column Fe::Page.table_name, :all_element_ids, :string
5
+ end
6
+ end
@@ -0,0 +1,20 @@
1
+ # This migration comes from fe_engine (originally 20140624182216)
2
+ class CreateFePhoneNumbers < ActiveRecord::Migration
3
+ def change
4
+ begin
5
+ create_table Fe::PhoneNumber do |t|
6
+ t.string :number
7
+ t.string :extensions
8
+ t.integer :person_id
9
+ t.string :location
10
+ t.boolean :primary
11
+ t.string :txt_to_email
12
+ t.integer :carrier_id
13
+ t.datetime :email_updated_at
14
+
15
+ t.timestamps
16
+ end
17
+ rescue
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from fe_engine (originally 20150713022326)
2
+ class AddLocaleColumns < ActiveRecord::Migration
3
+ def change
4
+ add_column Fe::QuestionSheet.table_name, :languages, :text
5
+ add_column Fe::Element.table_name, :label_translations, :text
6
+ add_column Fe::Element.table_name, :tip_translations, :text
7
+ add_column Fe::Element.table_name, :content_translations, :text
8
+ add_column Fe::Page.table_name, :label_translations, :text
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from fe_engine (originally 20150714220730)
2
+ class AddLocaleToAnswerSheet < ActiveRecord::Migration
3
+ def change
4
+ add_column Fe.answer_sheet_class.constantize.table_name, :locale, :string, default: 'en'
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from fe_engine (originally 20150928085325)
2
+ class ChangePagesAllElementIdsToText < ActiveRecord::Migration
3
+ def change
4
+ change_column Fe::Page.table_name, :all_element_ids, :text
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from fe_engine (originally 20150930191538)
2
+ class AddLocaleToReferenceSheets < ActiveRecord::Migration
3
+ def change
4
+ add_column Fe::ReferenceSheet.table_name, :locale, :string, default: 'en'
5
+ end
6
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20140625160545) do
14
+ ActiveRecord::Schema.define(version: 20150930191756) do
15
15
 
16
16
  create_table "create_fe_phone_numbers", force: true do |t|
17
17
  t.string "number"
@@ -50,13 +50,12 @@ ActiveRecord::Schema.define(version: 20140625160545) do
50
50
  t.datetime "updated_at"
51
51
  end
52
52
 
53
- add_index "fe_answer_sheet_question_sheets", ["answer_sheet_id", "question_sheet_id"], name: "answer_sheet_question_sheet"
53
+ add_index "fe_answer_sheet_question_sheets", ["answer_sheet_id", "question_sheet_id"], name: "answer_sheet_question_sheet", using: :btree
54
54
 
55
55
  create_table "fe_answers", force: true do |t|
56
56
  t.integer "answer_sheet_id", null: false
57
57
  t.integer "question_id", null: false
58
58
  t.text "value"
59
- t.string "short_value"
60
59
  t.integer "attachment_file_size"
61
60
  t.string "attachment_content_type"
62
61
  t.string "attachment_file_name"
@@ -65,8 +64,7 @@ ActiveRecord::Schema.define(version: 20140625160545) do
65
64
  t.datetime "updated_at"
66
65
  end
67
66
 
68
- add_index "fe_answers", ["answer_sheet_id", "question_id"], name: "answer_sheet_question"
69
- add_index "fe_answers", ["short_value"], name: "index_fe_answers_on_short_value"
67
+ add_index "fe_answers", ["answer_sheet_id", "question_id"], name: "answer_sheet_question", using: :btree
70
68
 
71
69
  create_table "fe_applications", force: true do |t|
72
70
  t.integer "applicant_id"
@@ -74,9 +72,10 @@ ActiveRecord::Schema.define(version: 20140625160545) do
74
72
  t.datetime "submitted_at"
75
73
  t.datetime "created_at"
76
74
  t.datetime "updated_at"
75
+ t.string "locale", default: "en"
77
76
  end
78
77
 
79
- add_index "fe_applications", ["applicant_id"], name: "question_sheet_id"
78
+ add_index "fe_applications", ["applicant_id"], name: "question_sheet_id", using: :btree
80
79
 
81
80
  create_table "fe_conditions", force: true do |t|
82
81
  t.integer "question_sheet_id", null: false
@@ -88,10 +87,10 @@ ActiveRecord::Schema.define(version: 20140625160545) do
88
87
  t.datetime "updated_at"
89
88
  end
90
89
 
91
- add_index "fe_conditions", ["question_sheet_id"], name: "index_fe_conditions_on_question_sheet_id"
92
- add_index "fe_conditions", ["toggle_id"], name: "index_fe_conditions_on_toggle_id"
93
- add_index "fe_conditions", ["toggle_page_id"], name: "index_fe_conditions_on_toggle_page_id"
94
- add_index "fe_conditions", ["trigger_id"], name: "index_fe_conditions_on_trigger_id"
90
+ add_index "fe_conditions", ["question_sheet_id"], name: "index_fe_conditions_on_question_sheet_id", using: :btree
91
+ add_index "fe_conditions", ["toggle_id"], name: "index_fe_conditions_on_toggle_id", using: :btree
92
+ add_index "fe_conditions", ["toggle_page_id"], name: "index_fe_conditions_on_toggle_page_id", using: :btree
93
+ add_index "fe_conditions", ["trigger_id"], name: "index_fe_conditions_on_trigger_id", using: :btree
95
94
 
96
95
  create_table "fe_elements", force: true do |t|
97
96
  t.integer "question_grid_id"
@@ -120,11 +119,18 @@ ActiveRecord::Schema.define(version: 20140625160545) do
120
119
  t.boolean "hide_label", default: false
121
120
  t.boolean "hide_option_labels", default: false
122
121
  t.integer "max_length"
122
+ t.string "conditional_type"
123
+ t.text "conditional_answer"
124
+ t.integer "choice_field_id"
125
+ t.boolean "share", default: false
126
+ t.text "label_translations"
127
+ t.text "tip_translations"
128
+ t.text "content_translations"
123
129
  end
124
130
 
125
- add_index "fe_elements", ["conditional_id"], name: "index_fe_elements_on_conditional_id"
126
- add_index "fe_elements", ["question_grid_id"], name: "index_fe_elements_on_question_grid_id"
127
- add_index "fe_elements", ["slug"], name: "index_fe_elements_on_slug"
131
+ add_index "fe_elements", ["conditional_id"], name: "index_fe_elements_on_conditional_id", using: :btree
132
+ add_index "fe_elements", ["question_grid_id"], name: "index_fe_elements_on_question_grid_id", using: :btree
133
+ add_index "fe_elements", ["slug"], name: "index_fe_elements_on_slug", using: :btree
128
134
 
129
135
  create_table "fe_email_templates", force: true do |t|
130
136
  t.string "name", limit: 1000, null: false
@@ -143,16 +149,18 @@ ActiveRecord::Schema.define(version: 20140625160545) do
143
149
  t.datetime "updated_at"
144
150
  end
145
151
 
146
- add_index "fe_page_elements", ["page_id", "element_id"], name: "page_element"
152
+ add_index "fe_page_elements", ["page_id", "element_id"], name: "page_element", using: :btree
147
153
 
148
154
  create_table "fe_pages", force: true do |t|
149
- t.integer "question_sheet_id", null: false
150
- t.string "label", limit: 60, null: false
155
+ t.integer "question_sheet_id", null: false
156
+ t.string "label", limit: 60, null: false
151
157
  t.integer "number"
152
- t.boolean "no_cache", default: false
153
- t.boolean "hidden", default: false
158
+ t.boolean "no_cache", default: false
159
+ t.boolean "hidden", default: false
154
160
  t.datetime "created_at"
155
161
  t.datetime "updated_at"
162
+ t.text "all_element_ids"
163
+ t.text "label_translations"
156
164
  end
157
165
 
158
166
  create_table "fe_people", force: true do |t|
@@ -169,6 +177,7 @@ ActiveRecord::Schema.define(version: 20140625160545) do
169
177
  t.boolean "archived", default: false
170
178
  t.datetime "created_at"
171
179
  t.datetime "updated_at"
180
+ t.text "languages"
172
181
  end
173
182
 
174
183
  create_table "fe_references", force: true do |t|
@@ -183,13 +192,15 @@ ActiveRecord::Schema.define(version: 20140625160545) do
183
192
  t.string "email"
184
193
  t.string "status"
185
194
  t.datetime "submitted_at"
195
+ t.datetime "started_at"
186
196
  t.string "access_key"
187
197
  t.datetime "created_at"
188
198
  t.datetime "updated_at"
199
+ t.string "locale", default: "en"
189
200
  end
190
201
 
191
- add_index "fe_references", ["applicant_answer_sheet_id"], name: "index_fe_references_on_applicant_answer_sheet_id"
192
- add_index "fe_references", ["question_id"], name: "index_fe_references_on_question_id"
202
+ add_index "fe_references", ["applicant_answer_sheet_id"], name: "index_fe_references_on_applicant_answer_sheet_id", using: :btree
203
+ add_index "fe_references", ["question_id"], name: "index_fe_references_on_question_id", using: :btree
193
204
 
194
205
  create_table "fe_users", force: true do |t|
195
206
  t.integer "user_id"
@@ -200,4 +211,23 @@ ActiveRecord::Schema.define(version: 20140625160545) do
200
211
  t.datetime "updated_at"
201
212
  end
202
213
 
214
+ create_table "phone_numbers", force: true do |t|
215
+ t.string "number"
216
+ t.string "extensions"
217
+ t.integer "person_id"
218
+ t.string "location"
219
+ t.boolean "primary"
220
+ t.string "txt_to_email"
221
+ t.integer "carrier_id"
222
+ t.datetime "email_updated_at"
223
+ t.datetime "created_at"
224
+ t.datetime "updated_at"
225
+ end
226
+
227
+ create_table "users", force: true do |t|
228
+ t.string "username"
229
+ t.string "email"
230
+ t.integer "person_id"
231
+ end
232
+
203
233
  end
@@ -0,0 +1,5 @@
1
+ DEPRECATION WARNING: `#ignore` is deprecated and will be removed in 5.0. Please use `#transient` instead. (called from block (3 levels) in <top (required)> at /Users/josh/htdocs/fe/spec/factories/question_sheet.rb:6)
2
+ DEPRECATION WARNING: `#ignore` is deprecated and will be removed in 5.0. Please use `#transient` instead. (called from block (3 levels) in <top (required)> at /Users/josh/htdocs/fe/spec/factories/question_sheet.rb:6)
3
+ DEPRECATION WARNING: `#ignore` is deprecated and will be removed in 5.0. Please use `#transient` instead. (called from block (3 levels) in <top (required)> at /Users/josh/htdocs/fe/spec/factories/question_sheet.rb:6)
4
+ DEPRECATION WARNING: `#ignore` is deprecated and will be removed in 5.0. Please use `#transient` instead. (called from block (3 levels) in <top (required)> at /Users/josh/htdocs/fe/spec/factories/question_sheet.rb:6)
5
+ DEPRECATION WARNING: `#ignore` is deprecated and will be removed in 5.0. Please use `#transient` instead. (called from block (3 levels) in <top (required)> at /Users/josh/htdocs/fe/spec/factories/question_sheet.rb:6)
@@ -2,6 +2,5 @@
2
2
 
3
3
  FactoryGirl.define do
4
4
  factory :application, :class => 'Fe::Application' do
5
- applicant_id 1
6
5
  end
7
6
  end
@@ -0,0 +1,6 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :dummy_application, :class => 'Application' do
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :dummy_person, :class => 'Person' do
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :dummy_user, :class => 'User' do
5
+ end
6
+ end
@@ -2,18 +2,43 @@ FactoryGirl.define do
2
2
  factory :element, class: Fe::Element do
3
3
  sequence :label do |n| "Label Element #{n}" end
4
4
  required true
5
- sequence :slug do |n| "element_#{n}" end
6
5
 
7
6
  factory :choice_field_element, class: Fe::ChoiceField do
8
7
  kind "Fe::ChoiceField"
9
8
  style "yes-no"
10
9
  content "Choice One\r\nChoice Two\r\nChoice Three"
11
10
  end
12
-
11
+ factory :date_field_element, class: Fe::DateField do
12
+ kind "Fe::DateField"
13
+ style "date"
14
+ end
13
15
  factory :text_field_element, class: Fe::TextField do
14
16
  kind "Fe::TextField"
15
17
  style "short"
16
18
  end
19
+ factory :question_grid, class: Fe::QuestionGrid do
20
+ kind "Fe::QuestionGrid"
21
+ style "grid"
22
+ end
23
+ factory :question_grid_with_total, class: Fe::QuestionGridWithTotal do
24
+ kind "Fe::QuestionGridWithTotal"
25
+ style "grid"
26
+ end
27
+ factory :reference_element, class: Fe::ReferenceQuestion do
28
+ kind "Fe::ReferenceQuestion"
29
+ style "staff"
30
+ end
31
+ factory :section, class: Fe::Section do
32
+ kind "Fe::Section"
33
+ style "section"
34
+ end
35
+ factory :attachment_field_element, class: Fe::AttachmentField do
36
+ kind "Fe::AttachmentField"
37
+ style "section"
38
+ end
39
+ factory :state_chooser_element, class: Fe::StateChooser do
40
+ kind "Fe::StateChooser"
41
+ style "section"
42
+ end
17
43
  end
18
44
  end
19
-
@@ -0,0 +1,5 @@
1
+ FactoryGirl.define do
2
+ factory :email_template, :class => 'Fe::EmailTemplate' do
3
+ name "Staff Payment Request"
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :fe_email_template, :class => Fe::EmailTemplate do
5
+ sequence(:content) { |n| "content_#{n}" }
6
+ sequence(:subject) { |n| "subject#{n}" }
7
+ enabled true
8
+ end
9
+ end
@@ -4,7 +4,5 @@ FactoryGirl.define do
4
4
  factory :fe_person, :class => 'Fe::Person' do
5
5
  first_name "MyString"
6
6
  last_name "MyString"
7
- user_id 1
8
- is_staff false
9
7
  end
10
8
  end
@@ -0,0 +1,6 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :fe_user, :class => 'Fe::User' do
5
+ end
6
+ end
@@ -3,7 +3,7 @@ FactoryGirl.define do
3
3
  sequence(:label) { |n| "Question Sheet #{n}"}
4
4
 
5
5
  factory :question_sheet_with_pages do
6
- ignore do
6
+ transient do
7
7
  pages_count 5
8
8
  end
9
9