sorbet-rails 0.7.4 → 0.7.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (360) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +7 -0
  3. data/.github/workflows/ci-master.yml +28 -0
  4. data/.github/workflows/ci.yml +26 -0
  5. data/.github/workflows/publish-gem.yml +27 -0
  6. data/CONTRIBUTING.md +1 -2
  7. data/Gemfile +5 -9
  8. data/README.md +18 -4
  9. data/Rakefile +13 -24
  10. data/lib/sorbet-rails/active_record_rbi_formatter.rb +12 -9
  11. data/lib/sorbet-rails/dependent_gem_rbis/activerecord.rbi +4 -0
  12. data/lib/sorbet-rails/dependent_gem_rbis/parlour.rbi +1 -1
  13. data/lib/sorbet-rails/gem_plugins/aasm_plugin.rb +50 -0
  14. data/lib/sorbet-rails/gem_plugins/money_rails_plugin.rb +76 -0
  15. data/lib/sorbet-rails/job_rbi_formatter.rb +1 -1
  16. data/lib/sorbet-rails/model_plugins/active_record_querying.rb +25 -1
  17. data/lib/sorbet-rails/model_plugins/active_record_serialized_attribute.rb +3 -2
  18. data/lib/sorbet-rails/model_plugins/base.rb +8 -1
  19. data/lib/sorbet-rails/model_plugins/custom_finder_methods.rb +1 -1
  20. data/lib/sorbet-rails/model_plugins/plugins.rb +6 -0
  21. data/lib/sorbet-rails/model_utils.rb +14 -7
  22. data/lib/sorbet-rails/rails_mixins/custom_finder_methods.rb +4 -0
  23. data/lib/sorbet-rails/railtie.rb +1 -1
  24. data/lib/sorbet-rails/routes_rbi_formatter.rb +8 -0
  25. data/lib/sorbet-rails/tasks/rails_rbi.rake +12 -8
  26. data/sorbet-rails.gemspec +2 -2
  27. data/spec/bin/run_all_specs.sh +3 -4
  28. data/spec/bin/run_spec.sh +4 -1
  29. data/spec/generators/rails-template.rb +3 -20
  30. data/spec/generators/sorbet_test_cases.rb +26 -4
  31. data/spec/rails_helper.rb +5 -5
  32. data/spec/rake_rails_rbi_models_spec.rb +11 -4
  33. data/spec/sorbet_spec.rb +2 -1
  34. data/spec/support/v5.2/Gemfile +1 -3
  35. data/spec/support/v5.2/Gemfile.lock +66 -71
  36. data/spec/support/v5.2/app/controllers/application_controller.rb +1 -1
  37. data/spec/support/v5.2/app/mailers/application_mailer.rb +1 -1
  38. data/spec/support/v5.2/app/mailers/daily_prophet_mailer.rb +1 -1
  39. data/spec/support/v5.2/app/mailers/hogwarts_acceptance_mailer.rb +1 -1
  40. data/spec/support/v5.2/app/models/spell_book.rb +1 -1
  41. data/spec/support/v5.2/app/models/wand.rb +1 -1
  42. data/spec/support/v5.2/app/models/wizard.rb +1 -1
  43. data/spec/support/v5.2/config/environments/development.rb +1 -1
  44. data/spec/support/v5.2/config/environments/production.rb +1 -1
  45. data/spec/support/v5.2/config/environments/test.rb +1 -1
  46. data/spec/support/v5.2/config/routes.rb +1 -1
  47. data/spec/support/v5.2/sorbet_test_cases.rb +26 -4
  48. data/spec/support/v6.0/Gemfile +1 -1
  49. data/spec/support/v6.0/Gemfile.lock +81 -85
  50. data/spec/support/v6.0/app/mailers/application_mailer.rb +1 -1
  51. data/spec/support/v6.0/config/environments/development.rb +1 -1
  52. data/spec/support/v6.0/config/environments/test.rb +1 -1
  53. data/spec/support/v6.0/config/initializers/cookies_serializer.rb +1 -1
  54. data/spec/support/v6.0/config/initializers/sorbet_rails.rb +1 -1
  55. data/spec/support/v6.0/config/routes.rb +1 -1
  56. data/spec/support/v6.0/sorbet_test_cases.rb +26 -4
  57. data/spec/support/{v5.1 → v6.1}/.gitignore +13 -2
  58. data/spec/support/{v5.1 → v6.1}/Gemfile +12 -15
  59. data/spec/support/{v5.1 → v6.1}/Gemfile.lock +87 -59
  60. data/spec/support/{v5.0 → v6.1}/README.md +0 -0
  61. data/spec/support/{v5.0 → v6.1}/Rakefile +0 -0
  62. data/spec/support/{v5.0 → v6.1}/app/assets/config/manifest.js +0 -0
  63. data/spec/support/{v5.0 → v6.1}/app/assets/images/.keep +0 -0
  64. data/spec/support/{v5.1 → v6.1}/app/assets/stylesheets/application.css +0 -0
  65. data/spec/support/{v5.0 → v6.1}/app/controllers/application_controller.rb +1 -2
  66. data/spec/support/{v5.0 → v6.1}/app/controllers/concerns/.keep +0 -0
  67. data/spec/support/{v5.0 → v6.1}/app/helpers/application_helper.rb +0 -0
  68. data/spec/support/{v5.0 → v6.1}/app/helpers/bar_helper.rb +0 -0
  69. data/spec/support/{v5.0 → v6.1}/app/helpers/baz_helper.rb +0 -0
  70. data/spec/support/{v5.0 → v6.1}/app/helpers/foo_helper.rb +0 -0
  71. data/spec/support/v6.1/app/jobs/application_job.rb +8 -0
  72. data/spec/support/{v5.0 → v6.1}/app/jobs/award_house_point_hourglasses.rb +0 -0
  73. data/spec/support/{v5.1 → v6.1}/app/mailers/application_mailer.rb +1 -1
  74. data/spec/support/{v5.0 → v6.1}/app/mailers/daily_prophet_mailer.rb +0 -0
  75. data/spec/support/{v5.0 → v6.1}/app/mailers/hogwarts_acceptance_mailer.rb +0 -0
  76. data/spec/support/{v5.0 → v6.1}/app/models/application_record.rb +0 -0
  77. data/spec/support/{v5.0 → v6.1}/app/models/concerns/.keep +0 -0
  78. data/spec/support/{v5.0 → v6.1}/app/models/concerns/mythical.rb +0 -0
  79. data/spec/support/{v5.1 → v6.1}/app/models/headmaster.rb +1 -1
  80. data/spec/support/{v5.1 → v6.1}/app/models/potion.rb +0 -0
  81. data/spec/support/{v5.1 → v6.1}/app/models/robe.rb +0 -0
  82. data/spec/support/{v5.0 → v6.1}/app/models/school.rb +1 -1
  83. data/spec/support/{v5.1 → v6.1}/app/models/spell.rb +0 -0
  84. data/spec/support/{v5.0 → v6.1}/app/models/spell_book.rb +0 -0
  85. data/spec/support/{v5.0 → v6.1}/app/models/squib.rb +0 -0
  86. data/spec/support/{v5.1 → v6.1}/app/models/subject.rb +0 -0
  87. data/spec/support/{v5.0 → v6.1}/app/models/wand.rb +0 -0
  88. data/spec/support/{v5.0 → v6.1}/app/models/wizard.rb +2 -1
  89. data/spec/support/{v5.1 → v6.1}/app/views/layouts/application.html.erb +2 -1
  90. data/spec/support/{v5.0 → v6.1}/app/views/layouts/mailer.html.erb +0 -0
  91. data/spec/support/{v5.0 → v6.1}/app/views/layouts/mailer.text.erb +0 -0
  92. data/spec/support/v6.1/bin/bundle +114 -0
  93. data/spec/support/{v5.0 → v6.1}/bin/rails +0 -0
  94. data/spec/support/{v5.0 → v6.1}/bin/rake +0 -0
  95. data/spec/support/{v5.1 → v6.1}/bin/setup +6 -11
  96. data/spec/support/{v5.1 → v6.1}/config/application.rb +8 -4
  97. data/spec/support/{v5.0 → v6.1}/config/boot.rb +0 -0
  98. data/spec/support/{v5.1 → v6.1}/config/database.yml +1 -1
  99. data/spec/support/{v5.0 → v6.1}/config/environment.rb +0 -0
  100. data/spec/support/{v5.1 → v6.1}/config/environments/development.rb +12 -4
  101. data/spec/support/{v5.1 → v6.1}/config/environments/production.rb +29 -7
  102. data/spec/support/{v5.1 → v6.1}/config/environments/test.rb +13 -7
  103. data/spec/support/{v5.0 → v6.1}/config/initializers/application_controller_renderer.rb +0 -0
  104. data/spec/support/{v5.0 → v6.1}/config/initializers/backtrace_silencers.rb +0 -0
  105. data/spec/support/v6.1/config/initializers/content_security_policy.rb +29 -0
  106. data/spec/support/{v5.1 → v6.1}/config/initializers/cookies_serializer.rb +1 -1
  107. data/spec/support/{v5.0 → v6.1}/config/initializers/filter_parameter_logging.rb +0 -0
  108. data/spec/support/{v5.0 → v6.1}/config/initializers/inflections.rb +0 -0
  109. data/spec/support/{v5.0 → v6.1}/config/initializers/mime_types.rb +0 -0
  110. data/spec/support/{v5.0 → v6.1}/config/initializers/sorbet_rails.rb +1 -1
  111. data/spec/support/{v5.0 → v6.1}/config/initializers/wrap_parameters.rb +0 -0
  112. data/spec/support/{v5.1 → v6.1}/config/locales/en.yml +1 -1
  113. data/spec/support/{v5.1 → v6.1}/config/puma.rb +8 -26
  114. data/spec/support/v6.1/config/routes.rb +5 -0
  115. data/spec/support/v6.1/config/storage.yml +34 -0
  116. data/spec/support/{v5.0 → v6.1}/config.ru +0 -0
  117. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000001_create_wizards.rb +2 -2
  118. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000002_create_wands.rb +2 -2
  119. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000003_create_spell_books.rb +2 -2
  120. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000004_add_more_column_types_to_wands.rb +2 -2
  121. data/spec/support/v6.1/db/migrate/20190620000005_add_broom_to_wizard.rb +6 -0
  122. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000006_add_more_enums_to_wizard.rb +2 -2
  123. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000007_add_type_to_wizard.rb +2 -2
  124. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000008_add_robe_to_wizard.rb +2 -2
  125. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000009_add_school.rb +2 -2
  126. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000010_add_subject.rb +2 -2
  127. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000011_add_subjects_wizards.rb +2 -2
  128. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000012_add_spell.rb +2 -2
  129. data/spec/support/{v5.1 → v6.1}/db/migrate/20190620000013_add_spells_spell_books.rb +2 -2
  130. data/spec/support/{v5.0 → v6.1}/db/migrate/20190620000014_create_headmasters.rb +2 -2
  131. data/spec/support/{v5.0 → v6.1}/db/migrate/20190620000015_add_serialized_to_wizards.rb +2 -2
  132. data/spec/support/{v5.1 → v6.1}/db/schema.rb +14 -11
  133. data/spec/support/{v5.0 → v6.1}/db/seeds.rb +0 -0
  134. data/spec/support/{v5.0 → v6.1}/lib/assets/.keep +0 -0
  135. data/spec/support/{v5.0 → v6.1}/lib/mythical_rbi_plugin.rb +0 -0
  136. data/spec/support/{v5.0 → v6.1}/lib/tasks/.keep +0 -0
  137. data/spec/support/{v5.0 → v6.1}/log/.keep +0 -0
  138. data/spec/support/{v5.0 → v6.1}/sorbet_test_cases.rb +26 -4
  139. data/spec/support/{v5.0/tmp → v6.1/storage}/.keep +0 -0
  140. data/spec/support/{v5.0/vendor/assets/stylesheets → v6.1/tmp}/.keep +0 -0
  141. data/spec/support/{v5.1/app/assets/images → v6.1/tmp/pids}/.keep +0 -0
  142. data/spec/support/{v5.1/app/controllers/concerns → v6.1/vendor}/.keep +0 -0
  143. data/spec/test_data/v5.2/expected_active_record_base.rbi +10 -10
  144. data/spec/test_data/v5.2/expected_active_record_relation.rbi +10 -10
  145. data/spec/test_data/v5.2/expected_attachment.rbi +13 -7
  146. data/spec/test_data/v5.2/expected_blob.rbi +13 -7
  147. data/spec/test_data/v5.2/expected_headmaster.rbi +13 -7
  148. data/spec/test_data/v5.2/expected_internal_metadata.rbi +13 -7
  149. data/spec/test_data/v5.2/expected_potion.rbi +13 -7
  150. data/spec/test_data/v5.2/expected_robe.rbi +13 -7
  151. data/spec/test_data/v5.2/expected_routes.rbi +8 -0
  152. data/spec/test_data/v5.2/expected_schema_migration.rbi +13 -7
  153. data/spec/test_data/v5.2/expected_school.rbi +13 -7
  154. data/spec/test_data/v5.2/expected_spell/habtm_spell_books.rbi +13 -7
  155. data/spec/test_data/v5.2/expected_spell.rbi +13 -7
  156. data/spec/test_data/v5.2/expected_spell_book/habtm_spells.rbi +13 -7
  157. data/spec/test_data/v5.2/expected_spell_book.rbi +13 -7
  158. data/spec/test_data/v5.2/expected_squib.rbi +15 -9
  159. data/spec/test_data/v5.2/expected_subject/habtm_wizards.rbi +13 -7
  160. data/spec/test_data/v5.2/expected_subject.rbi +13 -7
  161. data/spec/test_data/v5.2/expected_wand.rbi +13 -7
  162. data/spec/test_data/v5.2/expected_wizard/habtm_subjects.rbi +13 -7
  163. data/spec/test_data/v5.2/expected_wizard.rbi +15 -9
  164. data/spec/test_data/v5.2/expected_wizard_wo_spellbook.rbi +15 -9
  165. data/spec/test_data/v6.0/expected_active_record_base.rbi +10 -10
  166. data/spec/test_data/v6.0/expected_active_record_relation.rbi +10 -10
  167. data/spec/test_data/v6.0/expected_attachment.rbi +13 -7
  168. data/spec/test_data/v6.0/expected_blob.rbi +13 -7
  169. data/spec/test_data/v6.0/expected_headmaster.rbi +13 -7
  170. data/spec/test_data/v6.0/expected_internal_metadata.rbi +13 -7
  171. data/spec/test_data/v6.0/expected_potion.rbi +13 -7
  172. data/spec/test_data/v6.0/expected_robe.rbi +13 -7
  173. data/spec/test_data/v6.0/expected_routes.rbi +8 -0
  174. data/spec/test_data/v6.0/expected_schema_migration.rbi +13 -7
  175. data/spec/test_data/v6.0/expected_school.rbi +13 -7
  176. data/spec/test_data/v6.0/expected_spell/habtm_spell_books.rbi +13 -7
  177. data/spec/test_data/v6.0/expected_spell.rbi +13 -7
  178. data/spec/test_data/v6.0/expected_spell_book/habtm_spells.rbi +13 -7
  179. data/spec/test_data/v6.0/expected_spell_book.rbi +13 -7
  180. data/spec/test_data/v6.0/expected_squib.rbi +15 -9
  181. data/spec/test_data/v6.0/expected_subject/habtm_wizards.rbi +13 -7
  182. data/spec/test_data/v6.0/expected_subject.rbi +13 -7
  183. data/spec/test_data/v6.0/expected_wand.rbi +13 -7
  184. data/spec/test_data/v6.0/expected_wizard/habtm_subjects.rbi +13 -7
  185. data/spec/test_data/v6.0/expected_wizard.rbi +15 -9
  186. data/spec/test_data/v6.0/expected_wizard_wo_spellbook.rbi +15 -9
  187. data/spec/test_data/{v5.1 → v6.1}/expected_active_record_base.rbi +16 -16
  188. data/spec/test_data/{v5.1 → v6.1}/expected_active_record_relation.rbi +26 -29
  189. data/spec/test_data/{v5.0 → v6.1}/expected_application_job.rbi +0 -0
  190. data/spec/test_data/{v5.0 → v6.1}/expected_application_mailer.rbi +0 -0
  191. data/spec/test_data/v6.1/expected_attachment.rbi +334 -0
  192. data/spec/test_data/{v5.0 → v6.1}/expected_award_house_point_hourglasses.rbi +0 -0
  193. data/spec/test_data/v6.1/expected_blob.rbi +382 -0
  194. data/spec/test_data/{v5.0 → v6.1}/expected_custom_application_job.rbi +0 -0
  195. data/spec/test_data/{v5.0 → v6.1}/expected_custom_application_mailer.rbi +0 -0
  196. data/spec/test_data/{v5.0 → v6.1}/expected_custom_award_house_point_hourglasses.rbi +0 -0
  197. data/spec/test_data/{v5.0 → v6.1}/expected_custom_daily_prophet_mailer.rbi +0 -0
  198. data/spec/test_data/{v5.0 → v6.1}/expected_custom_hogwarts_acceptance_mailer.rbi +0 -0
  199. data/spec/test_data/{v5.0 → v6.1}/expected_daily_prophet_mailer.rbi +0 -0
  200. data/spec/test_data/{v5.1 → v6.1}/expected_habtm_subjects.rbi +48 -0
  201. data/spec/test_data/{v5.1 → v6.1}/expected_habtm_wizards.rbi +48 -0
  202. data/spec/test_data/{v5.1 → v6.1}/expected_headmaster.rbi +33 -3
  203. data/spec/test_data/{v5.0 → v6.1}/expected_helpers.rbi +0 -0
  204. data/spec/test_data/{v5.0 → v6.1}/expected_helpers_with_application_and_devise_helpers.rbi +0 -0
  205. data/spec/test_data/{v5.0 → v6.1}/expected_hogwarts_acceptance_mailer.rbi +0 -0
  206. data/spec/test_data/{v5.1 → v6.1}/expected_internal_metadata.rbi +33 -3
  207. data/spec/test_data/{v5.0 → v6.1}/expected_no_routes.rbi +0 -0
  208. data/spec/test_data/{v5.1 → v6.1}/expected_potion.rbi +33 -3
  209. data/spec/test_data/v6.1/expected_record.rbi +295 -0
  210. data/spec/test_data/{v5.1 → v6.1}/expected_robe.rbi +33 -3
  211. data/spec/test_data/v6.1/expected_routes.rbi +175 -0
  212. data/spec/test_data/{v5.1 → v6.1}/expected_schema_migration.rbi +33 -3
  213. data/spec/test_data/{v5.1 → v6.1}/expected_school.rbi +33 -3
  214. data/spec/test_data/{v5.1 → v6.1}/expected_spell/habtm_spell_books.rbi +33 -3
  215. data/spec/test_data/{v5.1 → v6.1}/expected_spell.rbi +33 -3
  216. data/spec/test_data/{v5.1 → v6.1}/expected_spell_book/habtm_spell_books.rbi +48 -0
  217. data/spec/test_data/{v5.1 → v6.1}/expected_spell_book/habtm_spells.rbi +33 -3
  218. data/spec/test_data/{v5.1 → v6.1}/expected_spell_book.rbi +69 -3
  219. data/spec/test_data/{v5.1 → v6.1}/expected_squib.rbi +505 -61
  220. data/spec/test_data/{v5.0 → v6.1}/expected_srb_tc_output.txt +0 -0
  221. data/spec/test_data/{v5.1 → v6.1}/expected_subject/habtm_wizards.rbi +33 -3
  222. data/spec/test_data/{v5.1 → v6.1}/expected_subject.rbi +33 -3
  223. data/spec/test_data/v6.1/expected_variant_record.rbi +370 -0
  224. data/spec/test_data/{v5.1 → v6.1}/expected_wand.rbi +99 -3
  225. data/spec/test_data/{v5.1 → v6.1}/expected_wizard/habtm_subjects.rbi +33 -3
  226. data/spec/test_data/{v5.1 → v6.1}/expected_wizard.rbi +505 -61
  227. data/spec/test_data/{v5.1 → v6.1}/expected_wizard_wo_spellbook.rbi +499 -55
  228. metadata +266 -501
  229. data/.travis.yml +0 -42
  230. data/lib/sorbet-rails/type_assert/actionpack.rbi +0 -4
  231. data/spec/support/v5.0/.gitignore +0 -21
  232. data/spec/support/v5.0/Gemfile +0 -37
  233. data/spec/support/v5.0/Gemfile.lock +0 -161
  234. data/spec/support/v5.0/app/assets/stylesheets/application.css +0 -15
  235. data/spec/support/v5.0/app/jobs/application_job.rb +0 -3
  236. data/spec/support/v5.0/app/mailers/application_mailer.rb +0 -5
  237. data/spec/support/v5.0/app/models/headmaster.rb +0 -8
  238. data/spec/support/v5.0/app/models/potion.rb +0 -6
  239. data/spec/support/v5.0/app/models/robe.rb +0 -4
  240. data/spec/support/v5.0/app/models/spell.rb +0 -5
  241. data/spec/support/v5.0/app/models/subject.rb +0 -5
  242. data/spec/support/v5.0/app/views/layouts/application.html.erb +0 -13
  243. data/spec/support/v5.0/bin/bundle +0 -3
  244. data/spec/support/v5.0/bin/setup +0 -34
  245. data/spec/support/v5.0/bin/update +0 -29
  246. data/spec/support/v5.0/config/application.rb +0 -27
  247. data/spec/support/v5.0/config/database.yml +0 -25
  248. data/spec/support/v5.0/config/environments/development.rb +0 -48
  249. data/spec/support/v5.0/config/environments/production.rb +0 -75
  250. data/spec/support/v5.0/config/environments/test.rb +0 -43
  251. data/spec/support/v5.0/config/initializers/cookies_serializer.rb +0 -6
  252. data/spec/support/v5.0/config/initializers/new_framework_defaults.rb +0 -27
  253. data/spec/support/v5.0/config/initializers/session_store.rb +0 -4
  254. data/spec/support/v5.0/config/locales/en.yml +0 -23
  255. data/spec/support/v5.0/config/puma.rb +0 -48
  256. data/spec/support/v5.0/config/routes.rb +0 -5
  257. data/spec/support/v5.0/db/migrate/20190620000001_create_wizards.rb +0 -14
  258. data/spec/support/v5.0/db/migrate/20190620000002_create_wands.rb +0 -12
  259. data/spec/support/v5.0/db/migrate/20190620000003_create_spell_books.rb +0 -10
  260. data/spec/support/v5.0/db/migrate/20190620000004_add_more_column_types_to_wands.rb +0 -17
  261. data/spec/support/v5.0/db/migrate/20190620000005_add_broom_to_wizard.rb +0 -6
  262. data/spec/support/v5.0/db/migrate/20190620000006_add_more_enums_to_wizard.rb +0 -9
  263. data/spec/support/v5.0/db/migrate/20190620000007_add_type_to_wizard.rb +0 -6
  264. data/spec/support/v5.0/db/migrate/20190620000008_add_robe_to_wizard.rb +0 -8
  265. data/spec/support/v5.0/db/migrate/20190620000009_add_school.rb +0 -10
  266. data/spec/support/v5.0/db/migrate/20190620000010_add_subject.rb +0 -8
  267. data/spec/support/v5.0/db/migrate/20190620000011_add_subjects_wizards.rb +0 -8
  268. data/spec/support/v5.0/db/migrate/20190620000012_add_spell.rb +0 -8
  269. data/spec/support/v5.0/db/migrate/20190620000013_add_spells_spell_books.rb +0 -8
  270. data/spec/support/v5.0/db/schema.rb +0 -96
  271. data/spec/support/v5.0/public/robots.txt +0 -5
  272. data/spec/support/v5.1/README.md +0 -24
  273. data/spec/support/v5.1/Rakefile +0 -6
  274. data/spec/support/v5.1/app/assets/config/manifest.js +0 -2
  275. data/spec/support/v5.1/app/controllers/application_controller.rb +0 -4
  276. data/spec/support/v5.1/app/helpers/application_helper.rb +0 -3
  277. data/spec/support/v5.1/app/helpers/bar_helper.rb +0 -3
  278. data/spec/support/v5.1/app/helpers/baz_helper.rb +0 -3
  279. data/spec/support/v5.1/app/helpers/foo_helper.rb +0 -3
  280. data/spec/support/v5.1/app/jobs/application_job.rb +0 -3
  281. data/spec/support/v5.1/app/jobs/award_house_point_hourglasses.rb +0 -12
  282. data/spec/support/v5.1/app/mailers/daily_prophet_mailer.rb +0 -9
  283. data/spec/support/v5.1/app/mailers/hogwarts_acceptance_mailer.rb +0 -29
  284. data/spec/support/v5.1/app/models/application_record.rb +0 -4
  285. data/spec/support/v5.1/app/models/concerns/.keep +0 -0
  286. data/spec/support/v5.1/app/models/concerns/mythical.rb +0 -11
  287. data/spec/support/v5.1/app/models/school.rb +0 -5
  288. data/spec/support/v5.1/app/models/spell_book.rb +0 -18
  289. data/spec/support/v5.1/app/models/squib.rb +0 -6
  290. data/spec/support/v5.1/app/models/wand.rb +0 -19
  291. data/spec/support/v5.1/app/models/wizard.rb +0 -65
  292. data/spec/support/v5.1/app/views/layouts/mailer.html.erb +0 -13
  293. data/spec/support/v5.1/app/views/layouts/mailer.text.erb +0 -1
  294. data/spec/support/v5.1/bin/bundle +0 -3
  295. data/spec/support/v5.1/bin/rails +0 -4
  296. data/spec/support/v5.1/bin/rake +0 -4
  297. data/spec/support/v5.1/bin/update +0 -29
  298. data/spec/support/v5.1/bin/yarn +0 -11
  299. data/spec/support/v5.1/config/boot.rb +0 -4
  300. data/spec/support/v5.1/config/environment.rb +0 -6
  301. data/spec/support/v5.1/config/initializers/application_controller_renderer.rb +0 -9
  302. data/spec/support/v5.1/config/initializers/backtrace_silencers.rb +0 -8
  303. data/spec/support/v5.1/config/initializers/filter_parameter_logging.rb +0 -5
  304. data/spec/support/v5.1/config/initializers/inflections.rb +0 -17
  305. data/spec/support/v5.1/config/initializers/mime_types.rb +0 -5
  306. data/spec/support/v5.1/config/initializers/sorbet_rails.rb +0 -3
  307. data/spec/support/v5.1/config/initializers/wrap_parameters.rb +0 -15
  308. data/spec/support/v5.1/config/routes.rb +0 -5
  309. data/spec/support/v5.1/config.ru +0 -5
  310. data/spec/support/v5.1/db/migrate/20190620000005_add_broom_to_wizard.rb +0 -6
  311. data/spec/support/v5.1/db/migrate/20190620000014_create_headmasters.rb +0 -9
  312. data/spec/support/v5.1/db/migrate/20190620000015_add_serialized_to_wizards.rb +0 -9
  313. data/spec/support/v5.1/db/seeds.rb +0 -8
  314. data/spec/support/v5.1/lib/assets/.keep +0 -0
  315. data/spec/support/v5.1/lib/mythical_rbi_plugin.rb +0 -16
  316. data/spec/support/v5.1/lib/tasks/.keep +0 -0
  317. data/spec/support/v5.1/log/.keep +0 -0
  318. data/spec/support/v5.1/package.json +0 -5
  319. data/spec/support/v5.1/public/robots.txt +0 -1
  320. data/spec/support/v5.1/sorbet_test_cases.rb +0 -409
  321. data/spec/support/v5.1/tmp/.keep +0 -0
  322. data/spec/support/v5.1/vendor/.keep +0 -0
  323. data/spec/test_data/v5.0/expected_active_record_base.rbi +0 -113
  324. data/spec/test_data/v5.0/expected_active_record_relation.rbi +0 -198
  325. data/spec/test_data/v5.0/expected_habtm_subjects.rbi +0 -660
  326. data/spec/test_data/v5.0/expected_habtm_wizards.rbi +0 -660
  327. data/spec/test_data/v5.0/expected_headmaster.rbi +0 -328
  328. data/spec/test_data/v5.0/expected_internal_metadata.rbi +0 -298
  329. data/spec/test_data/v5.0/expected_potion.rbi +0 -280
  330. data/spec/test_data/v5.0/expected_robe.rbi +0 -301
  331. data/spec/test_data/v5.0/expected_routes.rbi +0 -27
  332. data/spec/test_data/v5.0/expected_schema_migration.rbi +0 -271
  333. data/spec/test_data/v5.0/expected_school.rbi +0 -301
  334. data/spec/test_data/v5.0/expected_spell/habtm_spell_books.rbi +0 -319
  335. data/spec/test_data/v5.0/expected_spell.rbi +0 -292
  336. data/spec/test_data/v5.0/expected_spell_book/habtm_spell_books.rbi +0 -637
  337. data/spec/test_data/v5.0/expected_spell_book/habtm_spells.rbi +0 -319
  338. data/spec/test_data/v5.0/expected_spell_book.rbi +0 -415
  339. data/spec/test_data/v5.0/expected_squib.rbi +0 -832
  340. data/spec/test_data/v5.0/expected_subject/habtm_wizards.rbi +0 -319
  341. data/spec/test_data/v5.0/expected_subject.rbi +0 -292
  342. data/spec/test_data/v5.0/expected_wand.rbi +0 -497
  343. data/spec/test_data/v5.0/expected_wizard/habtm_subjects.rbi +0 -319
  344. data/spec/test_data/v5.0/expected_wizard.rbi +0 -908
  345. data/spec/test_data/v5.0/expected_wizard_wo_spellbook.rbi +0 -902
  346. data/spec/test_data/v5.1/expected_application_job.rbi +0 -20
  347. data/spec/test_data/v5.1/expected_application_mailer.rbi +0 -5
  348. data/spec/test_data/v5.1/expected_award_house_point_hourglasses.rbi +0 -20
  349. data/spec/test_data/v5.1/expected_custom_application_job.rbi +0 -21
  350. data/spec/test_data/v5.1/expected_custom_application_mailer.rbi +0 -6
  351. data/spec/test_data/v5.1/expected_custom_award_house_point_hourglasses.rbi +0 -21
  352. data/spec/test_data/v5.1/expected_custom_daily_prophet_mailer.rbi +0 -8
  353. data/spec/test_data/v5.1/expected_custom_hogwarts_acceptance_mailer.rbi +0 -21
  354. data/spec/test_data/v5.1/expected_daily_prophet_mailer.rbi +0 -7
  355. data/spec/test_data/v5.1/expected_helpers.rbi +0 -27
  356. data/spec/test_data/v5.1/expected_helpers_with_application_and_devise_helpers.rbi +0 -34
  357. data/spec/test_data/v5.1/expected_hogwarts_acceptance_mailer.rbi +0 -20
  358. data/spec/test_data/v5.1/expected_no_routes.rbi +0 -4
  359. data/spec/test_data/v5.1/expected_routes.rbi +0 -27
  360. data/spec/test_data/v5.1/expected_srb_tc_output.txt +0 -1
@@ -1,4 +0,0 @@
1
- # typed: strict
2
- # Be sure to restart your server when you modify this file.
3
-
4
- Rails.application.config.session_store :cookie_store, key: '_v5_0_session'
@@ -1,23 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
- en:
23
- hello: "Hello world"
@@ -1,48 +0,0 @@
1
- # typed: false
2
- # Puma can serve each request in a thread from an internal thread pool.
3
- # The `threads` method setting takes two numbers a minimum and maximum.
4
- # Any libraries that use thread pools should be configured to match
5
- # the maximum value specified for Puma. Default is set to 5 threads for minimum
6
- # and maximum, this matches the default thread size of Active Record.
7
- #
8
- threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
9
- threads threads_count, threads_count
10
-
11
- # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
12
- #
13
- port ENV.fetch("PORT") { 3000 }
14
-
15
- # Specifies the `environment` that Puma will run in.
16
- #
17
- environment ENV.fetch("RAILS_ENV") { "development" }
18
-
19
- # Specifies the number of `workers` to boot in clustered mode.
20
- # Workers are forked webserver processes. If using threads and workers together
21
- # the concurrency of the application would be max `threads` * `workers`.
22
- # Workers do not work on JRuby or Windows (both of which do not support
23
- # processes).
24
- #
25
- # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
26
-
27
- # Use the `preload_app!` method when specifying a `workers` number.
28
- # This directive tells Puma to first boot the application and load code
29
- # before forking the application. This takes advantage of Copy On Write
30
- # process behavior so workers use less memory. If you use this option
31
- # you need to make sure to reconnect any threads in the `on_worker_boot`
32
- # block.
33
- #
34
- # preload_app!
35
-
36
- # The code in the `on_worker_boot` will be called if you are using
37
- # clustered mode by specifying a number of `workers`. After each worker
38
- # process is booted this block will be run, if you are using `preload_app!`
39
- # option you will want to use this block to reconnect to any threads
40
- # or connections that may have been created at application boot, Ruby
41
- # cannot share connections between processes.
42
- #
43
- # on_worker_boot do
44
- # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
45
- # end
46
-
47
- # Allow puma to be restarted by `rails restart` command.
48
- plugin :tmp_restart
@@ -1,5 +0,0 @@
1
- # typed: false
2
- Rails.application.routes.draw do
3
- get 'test/index' => 'test#index'
4
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
5
- end
@@ -1,14 +0,0 @@
1
- # typed: false
2
- class CreateWizards < ActiveRecord::Migration[5.0]
3
- def change
4
- create_table :wizards do |t|
5
- t.string :name
6
- t.integer :house
7
- t.integer :professor
8
- t.string :parent_email
9
- t.text :notes
10
-
11
- t.timestamps null: false
12
- end
13
- end
14
- end
@@ -1,12 +0,0 @@
1
- # typed: false
2
- class CreateWands < ActiveRecord::Migration[5.0]
3
- def change
4
- create_table :wands do |t|
5
- t.references :wizard, unique: true, null: false
6
- t.string :wood_type
7
- t.integer :core_type
8
-
9
- t.timestamps
10
- end
11
- end
12
- end
@@ -1,10 +0,0 @@
1
- # typed: false
2
- class CreateSpellBooks < ActiveRecord::Migration[5.0]
3
- def change
4
- create_table :spell_books do |t|
5
- t.string :name
6
- t.references :wizard, null: false
7
- t.integer :book_type, null: false, default: 0
8
- end
9
- end
10
- end
@@ -1,17 +0,0 @@
1
- # typed: false
2
- class AddMoreColumnTypesToWands < ActiveRecord::Migration[5.0]
3
- def change
4
- add_column :wands, :flexibility, :float, null: false, default: 0.5
5
- add_column :wands, :hardness, :decimal, null: false, precision: 10, scale: 10, default: 5
6
- add_column :wands, :reflectance, :decimal, null: false, precision: 10, scale: 0, default: 0.5
7
- add_column :wands, :broken, :boolean, null: false, default: false
8
- add_column :wands, :broken_at, :datetime, null: true
9
- add_column :wands, :chosen_at_date, :date
10
- add_column :wands, :chosen_at_time, :time
11
- # JSON column type is only supported on 5.2 or higher
12
- unless ['5.0', '5.1'].include?(ENV['RAILS_VERSION'])
13
- add_column :wands, :spell_history, :json
14
- add_column :wands, :maker_info, :json, null: false, default: '{}'
15
- end
16
- end
17
- end
@@ -1,6 +0,0 @@
1
- # typed: false
2
- class AddBroomToWizard < ActiveRecord::Migration[5.0]
3
- def change
4
- add_column :wizards, :broom, :string
5
- end
6
- end
@@ -1,9 +0,0 @@
1
- # typed: false
2
- class AddMoreEnumsToWizard < ActiveRecord::Migration[5.0]
3
- def change
4
- add_column :wizards, :quidditch_position, :integer
5
- add_column :wizards, :hair_color, :integer
6
- add_column :wizards, :eye_color, :integer
7
- add_column :wizards, :hair_length, :integer
8
- end
9
- end
@@ -1,6 +0,0 @@
1
- # typed: false
2
- class AddTypeToWizard < ActiveRecord::Migration[5.0]
3
- def change
4
- add_column :wizards, :type, :string, null: false, default: 'Wizard'
5
- end
6
- end
@@ -1,8 +0,0 @@
1
- # typed: false
2
- class AddRobeToWizard < ActiveRecord::Migration[5.0]
3
- def change
4
- create_table :robes do |t|
5
- t.references :wizard
6
- end
7
- end
8
- end
@@ -1,10 +0,0 @@
1
- # typed: false
2
- class AddSchool < ActiveRecord::Migration[5.0]
3
- def change
4
- create_table :schools do |t|
5
- t.string :name
6
- end
7
- add_column :wizards, :school_id, :integer
8
- add_foreign_key :wizards, :schools
9
- end
10
- end
@@ -1,8 +0,0 @@
1
- # typed: false
2
- class AddSubject < ActiveRecord::Migration[5.0]
3
- def change
4
- create_table :subjects do |t|
5
- t.string :name
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- # typed: false
2
- class AddSubjectsWizards < ActiveRecord::Migration[5.0]
3
- def change
4
- create_join_table :subjects, :wizards, column_options: { null: true } do |t|
5
- t.index [:subject_id, :wizard_id]
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- # typed: false
2
- class AddSpell < ActiveRecord::Migration[5.0]
3
- def change
4
- create_table :spells do |t|
5
- t.string :name
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- # typed: false
2
- class AddSpellsSpellBooks < ActiveRecord::Migration[5.0]
3
- def change
4
- create_join_table :spells, :spell_books do |t|
5
- t.index [:spell_id, :spell_book_id]
6
- end
7
- end
8
- end
@@ -1,96 +0,0 @@
1
- # typed: false
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20190620000015) do
15
-
16
- create_table "headmasters", force: :cascade do |t|
17
- t.integer "school_id"
18
- t.integer "wizard_id"
19
- t.index ["school_id"], name: "index_headmasters_on_school_id"
20
- t.index ["wizard_id"], name: "index_headmasters_on_wizard_id"
21
- end
22
-
23
- create_table "robes", force: :cascade do |t|
24
- t.integer "wizard_id"
25
- t.index ["wizard_id"], name: "index_robes_on_wizard_id"
26
- end
27
-
28
- create_table "schools", force: :cascade do |t|
29
- t.string "name"
30
- end
31
-
32
- create_table "spell_books", force: :cascade do |t|
33
- t.string "name"
34
- t.integer "wizard_id", null: false
35
- t.integer "book_type", default: 0, null: false
36
- t.index ["wizard_id"], name: "index_spell_books_on_wizard_id"
37
- end
38
-
39
- create_table "spell_books_spells", id: false, force: :cascade do |t|
40
- t.integer "spell_id", null: false
41
- t.integer "spell_book_id", null: false
42
- t.index ["spell_id", "spell_book_id"], name: "index_spell_books_spells_on_spell_id_and_spell_book_id"
43
- end
44
-
45
- create_table "spells", force: :cascade do |t|
46
- t.string "name"
47
- end
48
-
49
- create_table "subjects", force: :cascade do |t|
50
- t.string "name"
51
- end
52
-
53
- create_table "subjects_wizards", id: false, force: :cascade do |t|
54
- t.integer "subject_id"
55
- t.integer "wizard_id"
56
- t.index ["subject_id", "wizard_id"], name: "index_subjects_wizards_on_subject_id_and_wizard_id"
57
- end
58
-
59
- create_table "wands", force: :cascade do |t|
60
- t.integer "wizard_id", null: false
61
- t.string "wood_type"
62
- t.integer "core_type"
63
- t.datetime "created_at", null: false
64
- t.datetime "updated_at", null: false
65
- t.float "flexibility", default: 0.5, null: false
66
- t.decimal "hardness", precision: 10, scale: 10, default: "5.0", null: false
67
- t.decimal "reflectance", precision: 10, default: 0, null: false
68
- t.boolean "broken", default: false, null: false
69
- t.datetime "broken_at"
70
- t.date "chosen_at_date"
71
- t.time "chosen_at_time"
72
- t.index ["wizard_id"], name: "index_wands_on_wizard_id"
73
- end
74
-
75
- create_table "wizards", force: :cascade do |t|
76
- t.string "name"
77
- t.integer "house"
78
- t.integer "professor"
79
- t.string "parent_email"
80
- t.text "notes"
81
- t.datetime "created_at", null: false
82
- t.datetime "updated_at", null: false
83
- t.string "broom"
84
- t.integer "quidditch_position"
85
- t.integer "hair_color"
86
- t.integer "eye_color"
87
- t.integer "hair_length"
88
- t.string "type", default: "Wizard", null: false
89
- t.integer "school_id"
90
- t.text "owl_results"
91
- t.text "newt_subjects"
92
- t.text "pets"
93
- t.text "patronus_characteristics"
94
- end
95
-
96
- end
@@ -1,5 +0,0 @@
1
- # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2
- #
3
- # To ban all spiders from the entire site uncomment the next two lines:
4
- # User-agent: *
5
- # Disallow: /
@@ -1,24 +0,0 @@
1
- # README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative 'config/application'
5
-
6
- Rails.application.load_tasks
@@ -1,2 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../stylesheets .css
@@ -1,4 +0,0 @@
1
- # typed: strict
2
- class ApplicationController < ActionController::Base
3
- protect_from_forgery with: :exception
4
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module ApplicationHelper
3
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module BarHelper
3
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module BazHelper
3
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- module FooHelper
3
- end
@@ -1,3 +0,0 @@
1
- # typed: strong
2
- class ApplicationJob < ActiveJob::Base
3
- end
@@ -1,12 +0,0 @@
1
- # typed: strong
2
- # N.B. You imagine the wizards update the point magically somehow?
3
- # Nope, there is a "goblin" that takes their "give points" request and do it
4
- # behind the scene.
5
- class AwardHousePointHourglasses < ApplicationJob
6
- extend T::Sig
7
-
8
- sig { params(student: Wizard, point: Integer).void }
9
- def perform(student:, point:)
10
- # TODO: award point to student's house
11
- end
12
- end
@@ -1,9 +0,0 @@
1
- # typed: strong
2
- class DailyProphetMailer < ApplicationMailer
3
- extend T::Sig
4
-
5
- sig { params(wizards: T::Array[Wizard], hotnews_only: T::Boolean).void }
6
- def notify_subscribers(wizards:, hotnews_only:)
7
- # TODO: mail the latest news to wizards!
8
- end
9
- end
@@ -1,29 +0,0 @@
1
- # typed: false
2
- class HogwartsAcceptanceMailer < ApplicationMailer
3
- extend T::Sig
4
-
5
- sig { params(student: Wizard).void }
6
- def notify(student)
7
- # TODO: mail acceptance letter to student
8
- end
9
-
10
- sig {
11
- params(
12
- teacher: Wizard,
13
- note: String,
14
- student: Wizard,
15
- special: T::Boolean,
16
- ).void
17
- }
18
- def notify_teacher(
19
- teacher,
20
- note=nil,
21
- student:,
22
- special: false
23
- ) # TODO: let the teacher know when a students accepted offer
24
- end
25
-
26
- def notify_retry(student)
27
- # TODO: send more owls!!
28
- end
29
- end
@@ -1,4 +0,0 @@
1
- # typed: strong
2
- class ApplicationRecord < ActiveRecord::Base
3
- self.abstract_class = true
4
- end
File without changes
@@ -1,11 +0,0 @@
1
- # typed: false
2
- require 'active_support/concern'
3
- module Mythical
4
- extend ActiveSupport::Concern
5
-
6
- class_methods do
7
- def mythicals
8
- all.to_a # yeah!
9
- end
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- # typed: strict
2
- class School < ApplicationRecord
3
- has_one :headmaster
4
- validates :headmaster, presence: true
5
- end
@@ -1,18 +0,0 @@
1
- # typed: strict
2
- class SpellBook < ApplicationRecord
3
- validates :name, length: { minimum: 5 }, presence: true
4
-
5
- # simulate when belongs_to is optional by default, but it is enforced at the DB level
6
- belongs_to :wizard, optional: true
7
-
8
- # habtm enforced at the DB level
9
- has_and_belongs_to_many :spells
10
-
11
- enum book_type: {
12
- unclassified: 0,
13
- biology: 1,
14
- dark_art: 999,
15
- }
16
-
17
- scope :recent, -> { where('created_at > ?', 1.month.ago) }
18
- end
@@ -1,6 +0,0 @@
1
- # typed: true
2
- class Squib < Wizard
3
- def is_magical
4
- false
5
- end
6
- end
@@ -1,19 +0,0 @@
1
- # typed: true
2
- class Wand < ApplicationRecord
3
- include Mythical
4
-
5
- self.skip_time_zone_conversion_for_attributes = [:broken_at]
6
-
7
- enum core_type: {
8
- phoenix_feather: 0,
9
- dragon_heartstring: 1,
10
- unicorn_tail_hair: 2,
11
- basilisk_horn: 3,
12
- }
13
-
14
- belongs_to :wizard, required: true
15
-
16
- def wood_type
17
- 'Type ' + super
18
- end
19
- end
@@ -1,65 +0,0 @@
1
- # typed: strict
2
- class Wizard < ApplicationRecord
3
- validates :name, length: { minimum: 5 }, presence: true
4
- # simulate conditional validation
5
- validates :parent_email, presence: true, if: :Slytherin?
6
-
7
- typed_enum house: {
8
- Gryffindor: 0,
9
- Hufflepuff: 1,
10
- Ravenclaw: 2,
11
- Slytherin: 3,
12
- }
13
-
14
- # To create conflict with enum
15
- class Professor; end
16
-
17
- enum professor: {
18
- "Severus Snape": 0,
19
- "Minerva McGonagall": 1,
20
- "Pomona Sprout": 2,
21
- "Filius Flitwick": 3,
22
- "Hagrid": 4,
23
- "Alastor 'Mad-Eye' Moody": 5,
24
- }
25
-
26
- typed_enum broom: {
27
- nimbus: 'nimbus',
28
- firebolt: 'firebolt',
29
- }, _prefix: true
30
-
31
- typed_enum quidditch_position: {
32
- keeper: 0,
33
- seeker: 1,
34
- beater: 2,
35
- chaser: 3,
36
- }, _prefix: :quidditch
37
-
38
- enum hair_color: {
39
- brown: 0,
40
- black: 1,
41
- blonde: 2,
42
- }, _suffix: :hair
43
-
44
- enum eye_color: {
45
- brown: 0,
46
- green: 1,
47
- blue: 2,
48
- }, _prefix: :color, _suffix: :eyes
49
-
50
- serialize :owl_results, Hash
51
- serialize :newt_subjects # no specific data type, uses the default YAML Object coder
52
- serialize :pets, Array
53
- serialize :patronus_characteristics, JSON
54
-
55
- has_one :wand
56
- has_many :spell_books
57
- # habtm which is optional at the db level
58
- has_and_belongs_to_many :subjects
59
-
60
- # simulate when belongs_to is optional by default
61
- belongs_to :school, optional: true
62
-
63
- scope :recent, -> { where('created_at > ?', 1.month.ago) }
64
-
65
- end
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>
@@ -1 +0,0 @@
1
- <%= yield %>
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../config/application', __dir__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run