fat_free_crm 0.20.1 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fat_free_crm might be problematic. Click here for more details.

Files changed (352) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +170 -0
  3. data/README.md +3 -6
  4. data/app/assets/config/fat_free_crm.js +3 -0
  5. data/app/assets/config/manifest.js +1 -0
  6. data/app/controllers/admin/field_groups_controller.rb +0 -2
  7. data/app/controllers/admin/tags_controller.rb +1 -1
  8. data/app/controllers/admin/users_controller.rb +1 -1
  9. data/app/controllers/application_controller.rb +11 -0
  10. data/app/controllers/comments_controller.rb +2 -0
  11. data/app/controllers/emails_controller.rb +2 -0
  12. data/app/controllers/entities/accounts_controller.rb +3 -1
  13. data/app/controllers/entities/campaigns_controller.rb +3 -1
  14. data/app/controllers/entities/contacts_controller.rb +3 -1
  15. data/app/controllers/entities/leads_controller.rb +4 -2
  16. data/app/controllers/entities/opportunities_controller.rb +3 -1
  17. data/app/controllers/entities_controller.rb +2 -0
  18. data/app/controllers/home_controller.rb +2 -0
  19. data/app/controllers/lists_controller.rb +2 -0
  20. data/app/controllers/tasks_controller.rb +3 -1
  21. data/app/controllers/users_controller.rb +2 -0
  22. data/app/helpers/accounts_helper.rb +2 -0
  23. data/app/helpers/application_helper.rb +22 -3
  24. data/app/helpers/tasks_helper.rb +1 -2
  25. data/app/models/entities/account.rb +1 -1
  26. data/app/models/entities/campaign.rb +1 -1
  27. data/app/models/entities/contact.rb +1 -1
  28. data/app/models/entities/lead.rb +1 -1
  29. data/app/models/entities/opportunity.rb +1 -1
  30. data/app/models/fields/custom_field.rb +2 -2
  31. data/app/models/observers/entity_observer.rb +1 -1
  32. data/app/models/polymorphic/avatar.rb +1 -30
  33. data/app/models/polymorphic/comment.rb +1 -1
  34. data/app/models/polymorphic/task.rb +1 -0
  35. data/app/models/setting.rb +4 -5
  36. data/app/models/users/user.rb +1 -1
  37. data/app/views/home/index.xls.builder +1 -0
  38. data/app/views/shared/_address.html.haml +1 -1
  39. data/bin/bundle +108 -2
  40. data/bin/rails +3 -3
  41. data/bin/rake +2 -2
  42. data/bin/setup +12 -15
  43. data/config/application.rb +22 -4
  44. data/config/boot.rb +3 -5
  45. data/config/cable.yml +10 -0
  46. data/config/database.yml +26 -0
  47. data/config/environment.rb +4 -3
  48. data/config/environments/development.rb +47 -11
  49. data/config/environments/production.rb +17 -15
  50. data/config/environments/test.rb +19 -9
  51. data/config/initializers/action_mailer.rb +1 -0
  52. data/config/initializers/content_security_policy.rb +21 -26
  53. data/config/initializers/custom_field_ransack_translations.rb +1 -0
  54. data/config/initializers/filter_parameter_logging.rb +6 -2
  55. data/config/initializers/inflections.rb +4 -4
  56. data/config/initializers/permissions_policy.rb +12 -0
  57. data/config/puma.rb +2 -2
  58. data/config/storage.yml +34 -0
  59. data/db/demo/field_groups.yml +2 -1
  60. data/db/migrate/20100928030617_drop_openid_tables.rb +2 -1
  61. data/db/migrate/20230526211831_create_active_storage_tables.active_storage.rb +51 -0
  62. data/db/migrate/20230526212613_convert_to_active_storage.rb +107 -0
  63. data/db/schema.rb +108 -76
  64. data/db/seeds/fields.rb +7 -21
  65. data/lib/development_tasks/license.rake +10 -10
  66. data/lib/fat_free_crm/callback.rb +2 -3
  67. data/lib/fat_free_crm/errors.rb +2 -10
  68. data/lib/fat_free_crm/exceptions.rb +1 -0
  69. data/lib/fat_free_crm/fields.rb +4 -5
  70. data/lib/fat_free_crm/gem_dependencies.rb +0 -1
  71. data/lib/fat_free_crm/i18n.rb +1 -1
  72. data/lib/fat_free_crm/mail_processor/dropbox.rb +1 -1
  73. data/lib/fat_free_crm/version.rb +3 -3
  74. data/public/avatars/User/2/large_rails.png +0 -0
  75. data/public/avatars/User/2/medium_rails.png +0 -0
  76. data/public/avatars/User/2/small_rails.png +0 -0
  77. data/public/avatars/User/2/thumb_rails.png +0 -0
  78. data/public/avatars/User/3/large_rails.png +0 -0
  79. data/public/avatars/User/3/medium_rails.png +0 -0
  80. data/public/avatars/User/3/original_rails.png +0 -0
  81. data/public/avatars/User/3/small_rails.png +0 -0
  82. data/public/avatars/User/3/thumb_rails.png +0 -0
  83. data/public/avatars/User/4/large_rails.png +0 -0
  84. data/public/avatars/User/4/medium_rails.png +0 -0
  85. data/public/avatars/User/4/original_rails.png +0 -0
  86. data/public/avatars/User/4/small_rails.png +0 -0
  87. data/public/avatars/User/4/thumb_rails.png +0 -0
  88. data/public/avatars/User/6/large_rails.png +0 -0
  89. data/public/avatars/User/6/medium_rails.png +0 -0
  90. data/public/avatars/User/6/original_rails.png +0 -0
  91. data/public/avatars/User/6/small_rails.png +0 -0
  92. data/public/avatars/User/6/thumb_rails.png +0 -0
  93. data/public/avatars/User/7/large_rails.png +0 -0
  94. data/public/avatars/User/7/medium_rails.png +0 -0
  95. data/public/avatars/User/7/original_rails.png +0 -0
  96. data/public/avatars/User/7/small_rails.png +0 -0
  97. data/public/avatars/User/7/thumb_rails.png +0 -0
  98. metadata +73 -288
  99. data/.docker/nginx/sites-enabled/ffcrm.conf +0 -8
  100. data/.github/workflows/brakeman-analysis.yml +0 -46
  101. data/.github/workflows/rubocop-analysis.yml +0 -40
  102. data/.github/workflows/ruby.yml +0 -52
  103. data/.gitignore +0 -39
  104. data/.rubocop.yml +0 -73
  105. data/.rubocop_todo.yml +0 -286
  106. data/.teatro.yml +0 -3
  107. data/.travis.yml +0 -60
  108. data/CONTRIBUTORS.md +0 -135
  109. data/Capfile +0 -27
  110. data/Dockerfile +0 -51
  111. data/Gemfile +0 -106
  112. data/Gemfile.lock +0 -529
  113. data/Guardfile +0 -26
  114. data/Procfile +0 -1
  115. data/SECURITY.md +0 -11
  116. data/Vagrantfile +0 -92
  117. data/config/initializers/new_framework_defaults_6_0.rb +0 -46
  118. data/custom_plan.rb +0 -11
  119. data/docker-compose.yml +0 -27
  120. data/fat_free_crm.gemspec +0 -62
  121. data/lib/tasks/.gitkeep +0 -0
  122. data/lib/tasks/.gitkeep~master +0 -0
  123. data/script/rails +0 -8
  124. data/spec/controllers/admin/groups_controller_spec.rb +0 -11
  125. data/spec/controllers/admin/users_controller_spec.rb +0 -251
  126. data/spec/controllers/applications_controller_spec.rb +0 -43
  127. data/spec/controllers/comments_controller_spec.rb +0 -195
  128. data/spec/controllers/emails_controller_spec.rb +0 -37
  129. data/spec/controllers/entities/accounts_controller_spec.rb +0 -607
  130. data/spec/controllers/entities/campaigns_controller_spec.rb +0 -645
  131. data/spec/controllers/entities/contacts_controller_spec.rb +0 -705
  132. data/spec/controllers/entities/leads_controller_spec.rb +0 -1009
  133. data/spec/controllers/entities/opportunities_controller_spec.rb +0 -904
  134. data/spec/controllers/entities_controller_spec.rb +0 -47
  135. data/spec/controllers/home_controller_spec.rb +0 -235
  136. data/spec/controllers/lists_controller_spec.rb +0 -11
  137. data/spec/controllers/tasks_controller_spec.rb +0 -517
  138. data/spec/controllers/users_controller_spec.rb +0 -375
  139. data/spec/factories/account_factories.rb +0 -40
  140. data/spec/factories/campaign_factories.rb +0 -30
  141. data/spec/factories/contact_factories.rb +0 -45
  142. data/spec/factories/field_factories.rb +0 -40
  143. data/spec/factories/lead_factories.rb +0 -36
  144. data/spec/factories/list_factories.rb +0 -13
  145. data/spec/factories/opportunity_factories.rb +0 -39
  146. data/spec/factories/sequences.rb +0 -32
  147. data/spec/factories/setting_factories.rb +0 -15
  148. data/spec/factories/shared_factories.rb +0 -70
  149. data/spec/factories/subscription_factories.rb +0 -13
  150. data/spec/factories/tag_factories.rb +0 -12
  151. data/spec/factories/task_factories.rb +0 -29
  152. data/spec/factories/user_factories.rb +0 -66
  153. data/spec/features/acceptance_helper.rb +0 -11
  154. data/spec/features/accounts_spec.rb +0 -126
  155. data/spec/features/admin/groups_spec.rb +0 -31
  156. data/spec/features/admin/users_spec.rb +0 -40
  157. data/spec/features/campaigns_spec.rb +0 -104
  158. data/spec/features/contacts_spec.rb +0 -134
  159. data/spec/features/dashboard_spec.rb +0 -67
  160. data/spec/features/devise/sign_in_spec.rb +0 -58
  161. data/spec/features/devise/sign_up_spec.rb +0 -36
  162. data/spec/features/leads_spec.rb +0 -138
  163. data/spec/features/opportunities_overview_spec.rb +0 -88
  164. data/spec/features/opportunities_spec.rb +0 -132
  165. data/spec/features/support/autocomlete_helper.rb +0 -17
  166. data/spec/features/support/browser.rb +0 -28
  167. data/spec/features/support/headless.rb +0 -19
  168. data/spec/features/support/paths.rb +0 -48
  169. data/spec/features/support/selector_helpers.rb +0 -36
  170. data/spec/features/tasks_spec.rb +0 -94
  171. data/spec/helpers/accounts_helper_spec.rb +0 -73
  172. data/spec/helpers/admin/field_groups_helper_spec.rb +0 -20
  173. data/spec/helpers/admin/plugins_helper_spec.rb +0 -11
  174. data/spec/helpers/admin/settings_helper_spec.rb +0 -11
  175. data/spec/helpers/admin/users_helper_spec.rb +0 -11
  176. data/spec/helpers/application_helper_spec.rb +0 -86
  177. data/spec/helpers/authentications_helper_spec.rb +0 -16
  178. data/spec/helpers/campaigns_helper_spec.rb +0 -16
  179. data/spec/helpers/comments_helper_spec.rb +0 -16
  180. data/spec/helpers/contacts_helper_spec.rb +0 -16
  181. data/spec/helpers/emails_helper_spec.rb +0 -11
  182. data/spec/helpers/fields_helper_spec.rb +0 -12
  183. data/spec/helpers/groups_helper_spec.rb +0 -21
  184. data/spec/helpers/home_helper_spec.rb +0 -16
  185. data/spec/helpers/leads_helper_spec.rb +0 -16
  186. data/spec/helpers/lists_helper_spec.rb +0 -21
  187. data/spec/helpers/opportunities_helper_spec.rb +0 -16
  188. data/spec/helpers/passwords_helper_spec.rb +0 -16
  189. data/spec/helpers/tasks_helper_spec.rb +0 -20
  190. data/spec/helpers/users_helper_spec.rb +0 -39
  191. data/spec/lib/comment_extensions_spec.rb +0 -42
  192. data/spec/lib/core_ext/string_spec.rb +0 -23
  193. data/spec/lib/errors_spec.rb +0 -32
  194. data/spec/lib/fields_spec.rb +0 -101
  195. data/spec/lib/mail_processor/base_spec.rb +0 -169
  196. data/spec/lib/mail_processor/comment_replies_spec.rb +0 -70
  197. data/spec/lib/mail_processor/dropbox_spec.rb +0 -306
  198. data/spec/lib/mail_processor/sample_emails/dropbox.rb +0 -173
  199. data/spec/lib/permissions_spec.rb +0 -155
  200. data/spec/lib/secret_token_generator_spec.rb +0 -69
  201. data/spec/lib/view_factory_spec.rb +0 -69
  202. data/spec/mailers/devise_mailer_spec.rb +0 -35
  203. data/spec/mailers/subscription_mailer_spec.rb +0 -48
  204. data/spec/mailers/user_mailer_spec.rb +0 -115
  205. data/spec/models/entities/account_contact_spec.rb +0 -34
  206. data/spec/models/entities/account_opportunity_spec.rb +0 -34
  207. data/spec/models/entities/account_spec.rb +0 -206
  208. data/spec/models/entities/campaign_spec.rb +0 -131
  209. data/spec/models/entities/contact_opportunity_spec.rb +0 -34
  210. data/spec/models/entities/contact_spec.rb +0 -314
  211. data/spec/models/entities/lead_spec.rb +0 -102
  212. data/spec/models/entities/opportunity_spec.rb +0 -299
  213. data/spec/models/fields/custom_field_date_pair_spec.rb +0 -92
  214. data/spec/models/fields/custom_field_pair_spec.rb +0 -76
  215. data/spec/models/fields/custom_field_spec.rb +0 -129
  216. data/spec/models/fields/field_group_spec.rb +0 -29
  217. data/spec/models/fields/field_spec.rb +0 -69
  218. data/spec/models/list_spec.rb +0 -19
  219. data/spec/models/observers/entity_observer_spec.rb +0 -74
  220. data/spec/models/polymorphic/address_spec.rb +0 -34
  221. data/spec/models/polymorphic/avatar_spec.rb +0 -46
  222. data/spec/models/polymorphic/comment_spec.rb +0 -45
  223. data/spec/models/polymorphic/email_spec.rb +0 -53
  224. data/spec/models/polymorphic/task_spec.rb +0 -395
  225. data/spec/models/polymorphic/version_spec.rb +0 -241
  226. data/spec/models/setting_spec.rb +0 -77
  227. data/spec/models/users/abilities/user_ability_spec.rb +0 -70
  228. data/spec/models/users/group_spec.rb +0 -11
  229. data/spec/models/users/permission_spec.rb +0 -58
  230. data/spec/models/users/preference_spec.rb +0 -71
  231. data/spec/models/users/user_spec.rb +0 -238
  232. data/spec/routing/accounts_routing_spec.rb +0 -60
  233. data/spec/routing/admin/users_routing_spec.rb +0 -40
  234. data/spec/routing/campaigns_routing_spec.rb +0 -64
  235. data/spec/routing/comments_routing_spec.rb +0 -32
  236. data/spec/routing/contacts_routing_spec.rb +0 -60
  237. data/spec/routing/emails_routing_spec.rb +0 -40
  238. data/spec/routing/leads_routing_spec.rb +0 -88
  239. data/spec/routing/opportunities_routing_spec.rb +0 -64
  240. data/spec/routing/tasks_routing_spec.rb +0 -68
  241. data/spec/routing/users_routing_spec.rb +0 -106
  242. data/spec/shared/controllers.rb +0 -99
  243. data/spec/shared/models.rb +0 -141
  244. data/spec/spec_helper.rb +0 -117
  245. data/spec/support/assert_select.rb +0 -167
  246. data/spec/support/devise_helpers.rb +0 -28
  247. data/spec/support/feature_helpers.rb +0 -32
  248. data/spec/support/macros.rb +0 -49
  249. data/spec/support/mail_processor_mocks.rb +0 -37
  250. data/spec/support/uploaded_file.rb +0 -10
  251. data/spec/views/accounts/_edit.haml_spec.rb +0 -43
  252. data/spec/views/accounts/_new.haml_spec.rb +0 -42
  253. data/spec/views/accounts/create.js.haml_spec.rb +0 -52
  254. data/spec/views/accounts/destroy.js.haml_spec.rb +0 -34
  255. data/spec/views/accounts/edit.js.haml_spec.rb +0 -66
  256. data/spec/views/accounts/index.haml_spec.rb +0 -43
  257. data/spec/views/accounts/index.js.haml_spec.rb +0 -34
  258. data/spec/views/accounts/new.js.haml_spec.rb +0 -44
  259. data/spec/views/accounts/show.haml_spec.rb +0 -38
  260. data/spec/views/accounts/update.js.haml_spec.rb +0 -93
  261. data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -30
  262. data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +0 -31
  263. data/spec/views/admin/field_groups/edit.js.haml_spec.rb +0 -24
  264. data/spec/views/admin/field_groups/new.js.haml_spec.rb +0 -25
  265. data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -29
  266. data/spec/views/admin/users/_create.haml_spec.rb +0 -23
  267. data/spec/views/admin/users/create.js.haml_spec.rb +0 -41
  268. data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -47
  269. data/spec/views/admin/users/edit.js.haml_spec.rb +0 -44
  270. data/spec/views/admin/users/index.haml_spec.rb +0 -22
  271. data/spec/views/admin/users/index.js.haml_spec.rb +0 -26
  272. data/spec/views/admin/users/new.js.haml_spec.rb +0 -34
  273. data/spec/views/admin/users/reactivate.js.haml_spec.rb +0 -22
  274. data/spec/views/admin/users/show.haml_spec.rb +0 -18
  275. data/spec/views/admin/users/suspend.js.haml_spec.rb +0 -22
  276. data/spec/views/admin/users/update.js.haml_spec.rb +0 -37
  277. data/spec/views/application/auto_complete.haml_spec.rb +0 -48
  278. data/spec/views/campaigns/_edit.haml_spec.rb +0 -44
  279. data/spec/views/campaigns/_new.haml_spec.rb +0 -41
  280. data/spec/views/campaigns/create.js.haml_spec.rb +0 -49
  281. data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -31
  282. data/spec/views/campaigns/edit.js.haml_spec.rb +0 -66
  283. data/spec/views/campaigns/index.haml_spec.rb +0 -37
  284. data/spec/views/campaigns/index.js.haml_spec.rb +0 -34
  285. data/spec/views/campaigns/new.js.haml_spec.rb +0 -50
  286. data/spec/views/campaigns/show.haml_spec.rb +0 -38
  287. data/spec/views/campaigns/update.js.haml_spec.rb +0 -78
  288. data/spec/views/comments/edit.js.haml_spec.rb +0 -30
  289. data/spec/views/contacts/_edit.haml_spec.rb +0 -73
  290. data/spec/views/contacts/_new.haml_spec.rb +0 -52
  291. data/spec/views/contacts/create.js.haml_spec.rb +0 -65
  292. data/spec/views/contacts/destroy.js.haml_spec.rb +0 -45
  293. data/spec/views/contacts/edit.js.haml_spec.rb +0 -74
  294. data/spec/views/contacts/index.haml_spec.rb +0 -37
  295. data/spec/views/contacts/index.js.html_spec.rb +0 -34
  296. data/spec/views/contacts/new.js.haml_spec.rb +0 -47
  297. data/spec/views/contacts/show.haml_spec.rb +0 -35
  298. data/spec/views/contacts/update.js.haml_spec.rb +0 -128
  299. data/spec/views/home/index.haml_spec.rb +0 -36
  300. data/spec/views/home/index.js.haml_spec.rb +0 -33
  301. data/spec/views/home/options.js.haml_spec.rb +0 -53
  302. data/spec/views/leads/_convert.haml_spec.rb +0 -30
  303. data/spec/views/leads/_edit.haml_spec.rb +0 -47
  304. data/spec/views/leads/_new.haml_spec.rb +0 -45
  305. data/spec/views/leads/_sidebar_show.haml_spec.rb +0 -31
  306. data/spec/views/leads/convert.js.haml_spec.rb +0 -79
  307. data/spec/views/leads/create.js.haml_spec.rb +0 -67
  308. data/spec/views/leads/destroy.js.haml_spec.rb +0 -47
  309. data/spec/views/leads/edit.js.haml_spec.rb +0 -76
  310. data/spec/views/leads/index.haml_spec.rb +0 -37
  311. data/spec/views/leads/index.js.haml_spec.rb +0 -34
  312. data/spec/views/leads/new.js.haml_spec.rb +0 -47
  313. data/spec/views/leads/promote.js.haml_spec.rb +0 -135
  314. data/spec/views/leads/reject.js.haml_spec.rb +0 -45
  315. data/spec/views/leads/show.haml_spec.rb +0 -32
  316. data/spec/views/leads/update.js.haml_spec.rb +0 -118
  317. data/spec/views/opportunities/_edit.haml_spec.rb +0 -70
  318. data/spec/views/opportunities/_new.haml_spec.rb +0 -51
  319. data/spec/views/opportunities/create.js.haml_spec.rb +0 -86
  320. data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -64
  321. data/spec/views/opportunities/edit.js.haml_spec.rb +0 -75
  322. data/spec/views/opportunities/index.haml_spec.rb +0 -38
  323. data/spec/views/opportunities/index.js.haml_spec.rb +0 -35
  324. data/spec/views/opportunities/new.js.haml_spec.rb +0 -54
  325. data/spec/views/opportunities/show.haml_spec.rb +0 -35
  326. data/spec/views/opportunities/update.js.haml_spec.rb +0 -143
  327. data/spec/views/tasks/_edit.haml_spec.rb +0 -50
  328. data/spec/views/tasks/complete.js.haml_spec.rb +0 -67
  329. data/spec/views/tasks/create.js.haml_spec.rb +0 -119
  330. data/spec/views/tasks/destroy.js.haml_spec.rb +0 -57
  331. data/spec/views/tasks/edit.js.haml_spec.rb +0 -76
  332. data/spec/views/tasks/index.haml_spec.rb +0 -46
  333. data/spec/views/tasks/new.js.haml_spec.rb +0 -49
  334. data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -45
  335. data/spec/views/tasks/update.js.haml_spec.rb +0 -140
  336. data/spec/views/users/avatar.js.haml_spec.rb +0 -35
  337. data/spec/views/users/change_password.js.haml_spec.rb +0 -51
  338. data/spec/views/users/edit.js.haml_spec.rb +0 -35
  339. data/spec/views/users/password.js.haml_spec.rb +0 -36
  340. data/spec/views/users/update.js.haml_spec.rb +0 -46
  341. data/spec/views/users/upload_avatar.js.haml_spec.rb +0 -45
  342. data/vendor/gems/globby-0.1.2/LICENSE.txt +0 -20
  343. data/vendor/gems/globby-0.1.2/README.md +0 -65
  344. data/vendor/gems/globby-0.1.2/Rakefile +0 -9
  345. data/vendor/gems/globby-0.1.2/lib/globby/glob.rb +0 -90
  346. data/vendor/gems/globby-0.1.2/lib/globby/globject.rb +0 -18
  347. data/vendor/gems/globby-0.1.2/lib/globby/result.rb +0 -20
  348. data/vendor/gems/globby-0.1.2/lib/globby.rb +0 -47
  349. data/vendor/gems/globby-0.1.2/spec/gitignore_spec.rb +0 -109
  350. data/vendor/gems/globby-0.1.2/spec/globby_spec.rb +0 -93
  351. data/zeus.json +0 -22
  352. /data/{spec/fixtures/rails.png → public/avatars/User/2/original_rails.png} +0 -0
@@ -21,39 +21,10 @@
21
21
  #
22
22
 
23
23
  class Avatar < ActiveRecord::Base
24
- STYLES = { large: "75x75#", medium: "50x50#", small: "25x25#", thumb: "16x16#" }.freeze
25
-
26
24
  belongs_to :user
27
25
  belongs_to :entity, polymorphic: true
28
26
 
29
- # We want to store avatars in separate directories based on entity type
30
- # (i.e. /avatar/User/, /avatars/Lead/, etc.), so we are adding :entity_type
31
- # interpolation to the Paperclip::Interpolations module. Also, Paperclip
32
- # doesn't seem to care preserving styles hash so we must use STYLES.dup.
33
- #----------------------------------------------------------------------------
34
- Paperclip::Interpolations.module_eval do
35
- def entity_type(attachment, _style_name = nil)
36
- attachment.instance.entity_type
37
- end
38
- end
39
- has_attached_file :image, styles: STYLES.dup, url: "/avatars/:entity_type/:id/:style_:filename", default_url: "/assets/avatar.jpg"
40
- validates_attachment :image, presence: true,
41
- content_type: { content_type: ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'] }
42
-
43
- # Convert STYLE symbols to 'w x h' format for Gravatar and Rails
44
- # e.g. Avatar.size_from_style(:size => :large) -> '75x75'
45
- # Allow options to contain :width and :height override keys
46
- #----------------------------------------------------------------------------
47
- def self.size_from_style!(options)
48
- if options[:width] && options[:height]
49
- options[:size] = %i[width height].map { |d| options[d] }.join("x")
50
- options.delete(:width)
51
- options.delete(:height)
52
- elsif Avatar::STYLES.keys.include?(options[:size])
53
- options[:size] = Avatar::STYLES[options[:size]].sub(/\#\z/, '')
54
- end
55
- options
56
- end
27
+ has_one_attached :image
57
28
 
58
29
  ActiveSupport.run_load_hooks(:fat_free_crm_avatar, self)
59
30
  end
@@ -54,7 +54,7 @@ class Comment < ActiveRecord::Base
54
54
  def notify_subscribers
55
55
  commentable.subscribed_users.reject { |user_id| user_id == user.id }.each do |subscriber_id|
56
56
  if subscriber = User.find_by_id(subscriber_id)
57
- SubscriptionMailer.comment_notification(subscriber, self).deliver_now
57
+ SubscriptionMailer.comment_notification(subscriber, self).deliver_later
58
58
  end
59
59
  end
60
60
  end
@@ -31,6 +31,7 @@ class Task < ActiveRecord::Base
31
31
  include ActiveModel::Serializers::Xml
32
32
 
33
33
  attr_accessor :calendar
34
+
34
35
  ALLOWED_VIEWS = %w[pending assigned completed]
35
36
 
36
37
  belongs_to :user
@@ -58,13 +58,11 @@ class Setting < ActiveRecord::Base
58
58
  return cache[name] if cache.key?(name)
59
59
 
60
60
  # Check database
61
- if database_and_table_exists?
62
- if setting = find_by_name(name.to_s)
63
- return cache[name] = setting.value unless setting.value.nil?
64
- end
61
+ if database_and_table_exists? && (setting = find_by_name(name.to_s))&.value.present?
62
+ return cache[name] = setting.value
65
63
  end
66
64
  # Check YAML settings
67
- return cache[name] = yaml_settings[name] if yaml_settings.key?(name)
65
+ cache[name] = yaml_settings[name] if yaml_settings.key?(name)
68
66
  end
69
67
 
70
68
  # Set setting value
@@ -73,6 +71,7 @@ class Setting < ActiveRecord::Base
73
71
  raise ArgumentError, "name cannot be blank" if name.blank?
74
72
 
75
73
  return nil unless database_and_table_exists?
74
+
76
75
  setting = find_by_name(name.to_s) || new(name: name.to_s)
77
76
  setting.value = value
78
77
  setting.save
@@ -61,7 +61,7 @@ class User < ActiveRecord::Base
61
61
  has_many :opportunities
62
62
  has_many :assigned_opportunities, class_name: 'Opportunity', foreign_key: 'assigned_to'
63
63
  has_many :permissions, dependent: :destroy
64
- has_many :preferences, dependent: :destroy
64
+ has_many :preferences, class_name: 'Preference', dependent: :destroy
65
65
  has_many :lists
66
66
  has_and_belongs_to_many :groups
67
67
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  xml.Worksheet 'ss:Name' => I18n.t(:tab_dashboard) do
3
4
  xml.Table do
4
5
  unless @activities.empty?
@@ -41,4 +41,4 @@
41
41
  = address_field(a, :zipcode, "width:80px;")
42
42
  %td= spacer
43
43
  %td
44
- = a.country_select(:country, priority_countries, { include_blank: "" }, {:"data-placeholder" => t(:select_a_country), style: "width:150px; margin-top:6px", class: 'select2'})
44
+ = a.country_select(:country, priority_countries: priority_countries, include_blank: "", :"data-placeholder" => t(:select_a_country), style: "width:150px; margin-top:6px", class: 'select2')
data/bin/bundle CHANGED
@@ -1,5 +1,111 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5
- load Gem.bin_path('bundler', 'bundle')
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV["BUNDLER_VERSION"]
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+
28
+ bundler_version = nil
29
+ update_index = nil
30
+ ARGV.each_with_index do |a, i|
31
+ bundler_version = a if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
32
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
33
+
34
+ bundler_version = Regexp.last_match(1)
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV["BUNDLE_GEMFILE"]
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../Gemfile", __dir__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+
59
+ lockfile_contents = File.read(lockfile)
60
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
61
+
62
+ Regexp.last_match(1)
63
+ end
64
+
65
+ def bundler_requirement
66
+ @bundler_requirement ||=
67
+ env_var_version ||
68
+ cli_arg_version ||
69
+ bundler_requirement_for(lockfile_version)
70
+ end
71
+
72
+ def bundler_requirement_for(version)
73
+ return "#{Gem::Requirement.default}.a" unless version
74
+
75
+ bundler_gem_version = Gem::Version.new(version)
76
+
77
+ bundler_gem_version.approximate_recommendation
78
+ end
79
+
80
+ def load_bundler!
81
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
82
+
83
+ activate_bundler
84
+ end
85
+
86
+ def activate_bundler
87
+ gem_error = activation_error_handling do
88
+ gem "bundler", bundler_requirement
89
+ end
90
+ return if gem_error.nil?
91
+
92
+ require_error = activation_error_handling do
93
+ require "bundler/version"
94
+ end
95
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
96
+
97
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
98
+ exit 42
99
+ end
100
+
101
+ def activation_error_handling
102
+ yield
103
+ nil
104
+ rescue StandardError, LoadError => e
105
+ e
106
+ end
107
+ end
108
+
109
+ m.load_bundler!
110
+
111
+ load Gem.bin_path("bundler", "bundle") if m.invoked_as_script?
data/bin/rails CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- APP_PATH = File.expand_path('../config/application', __dir__)
5
- require_relative '../config/boot'
6
- require 'rails/commands'
4
+ APP_PATH = File.expand_path("../config/application", __dir__)
5
+ require_relative "../config/boot"
6
+ require "rails/commands"
data/bin/rake CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require_relative '../config/boot'
5
- require 'rake'
4
+ require_relative "../config/boot"
5
+ require "rake"
6
6
  Rake.application.run
data/bin/setup CHANGED
@@ -1,38 +1,35 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'fileutils'
4
+ require "fileutils"
5
5
 
6
6
  # path to your application root.
7
- APP_ROOT = File.expand_path('..', __dir__)
7
+ APP_ROOT = File.expand_path("..", __dir__)
8
8
 
9
9
  def system!(*args)
10
10
  system(*args) || abort("\n== Command #{args} failed ==")
11
11
  end
12
12
 
13
13
  FileUtils.chdir APP_ROOT do
14
- # This script is a way to setup or update your development environment automatically.
15
- # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
14
+ # This script is a way to set up or update your development environment automatically.
15
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
16
16
  # Add necessary setup steps to this file.
17
17
 
18
- puts '== Installing dependencies =='
19
- system! 'gem install bundler --conservative'
20
- system('bundle check') || system!('bundle install')
21
-
22
- # Install JavaScript dependencies
23
- # system('bin/yarn')
18
+ puts "== Installing dependencies =="
19
+ system! "gem install bundler --conservative"
20
+ system("bundle check") || system!("bundle install")
24
21
 
25
22
  # puts "\n== Copying sample files =="
26
- # unless File.exist?('config/database.yml')
27
- # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
23
+ # unless File.exist?("config/database.yml")
24
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
28
25
  # end
29
26
 
30
27
  puts "\n== Preparing database =="
31
- system! 'bin/rails db:prepare'
28
+ system! "bin/rails db:prepare"
32
29
 
33
30
  puts "\n== Removing old logs and tempfiles =="
34
- system! 'bin/rails log:clear tmp:clear'
31
+ system! "bin/rails log:clear tmp:clear"
35
32
 
36
33
  puts "\n== Restarting application server =="
37
- system! 'bin/rails restart'
34
+ system! "bin/rails restart"
38
35
  end
@@ -12,6 +12,7 @@ require 'rails/all'
12
12
 
13
13
  # Pick the frameworks you want:
14
14
  require "active_record/railtie"
15
+ require "active_storage/engine"
15
16
  require "action_controller/railtie"
16
17
  require "action_mailer/railtie"
17
18
  require "sprockets/railtie"
@@ -29,11 +30,15 @@ require 'fat_free_crm/gem_ext/rails/engine'
29
30
  module FatFreeCRM
30
31
  class Application < Rails::Application
31
32
  # Initialize configuration defaults for originally generated Rails version.
32
- config.load_defaults 6.0
33
+ config.load_defaults 7.0
33
34
 
34
- # Settings in config/environments/* take precedence over those specified here.
35
- # Application configuration should go into files in config/initializers
36
- # -- all .rb files in that directory are automatically loaded.
35
+ # Configuration for the application, engines, and railties goes here.
36
+ #
37
+ # These settings can be overridden in specific environments using the files
38
+ # in config/environments, which are processed later.
39
+ #
40
+ # config.time_zone = "Central Time (US & Canada)"
41
+ # config.eager_load_paths << Rails.root.join("extras")
37
42
 
38
43
  # Models are organized in sub-directories
39
44
  config.autoload_paths += Dir[Rails.root.join("app/models/**")] +
@@ -72,6 +77,19 @@ module FatFreeCRM
72
77
 
73
78
  # Configure sensitive parameters which will be filtered from the log file.
74
79
  config.filter_parameters += %i[password encrypted_password password_salt password_confirmation]
80
+
81
+ # Enable support for loading via Psych, required by PaperTrail
82
+ config.active_record.use_yaml_unsafe_load = false
83
+ config.active_record.yaml_column_permitted_classes = [
84
+ ::ActiveRecord::Type::Time::Value,
85
+ ::ActiveSupport::HashWithIndifferentAccess, # for Field#settings serialization see app/models/fields/field.rb
86
+ ::ActiveSupport::TimeWithZone,
87
+ ::ActiveSupport::TimeZone,
88
+ ::BigDecimal,
89
+ ::Date,
90
+ ::Symbol,
91
+ ::Time
92
+ ]
75
93
  end
76
94
  end
77
95
 
data/config/boot.rb CHANGED
@@ -6,9 +6,7 @@
6
6
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
7
7
  #------------------------------------------------------------------------------
8
8
 
9
- # Set up gems listed in the Gemfile.
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
9
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11
10
 
12
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
13
-
14
- require 'bootsnap/setup'
11
+ require "bundler/setup" # Set up gems listed in the Gemfile.
12
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
data/config/cable.yml ADDED
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: test
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: fat_free_crm_production
@@ -0,0 +1,26 @@
1
+ ---
2
+ development: &development
3
+ adapter: postgresql
4
+ database: fat_free_crm_development
5
+ username: postgres
6
+ password:
7
+ host: localhost
8
+ port: 5432
9
+ schema_search_path: public
10
+ min_messages: warning
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ <<: *development
17
+ database: fat_free_crm_test
18
+
19
+ production:
20
+ <<: *development
21
+ database: fat_free_crm_production
22
+
23
+ staging:
24
+ <<: *development
25
+ database: fat_free_crm_staging
26
+
@@ -5,8 +5,9 @@
5
5
  # Fat Free CRM is freely distributable under the terms of MIT license.
6
6
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
7
7
  #------------------------------------------------------------------------------
8
- # Load the rails application
9
- require_relative 'application'
10
8
 
11
- # Initialize the rails application
9
+ # Load the Rails application.
10
+ require_relative "application"
11
+
12
+ # Initialize the Rails application.
12
13
  Rails.application.initialize!
@@ -7,35 +7,59 @@
7
7
  #------------------------------------------------------------------------------
8
8
  if defined?(FatFreeCRM::Application)
9
9
  FatFreeCRM::Application.configure do
10
- # Settings specified here will take precedence over those in config/application.rb
11
- config.eager_load = false
10
+ # Settings specified here will take precedence over those in config/application.rb.
12
11
 
13
- # In the development environment your application's code is reloaded on
14
- # every request. This slows down response time but is perfect for development
12
+ # In the development environment your application's code is reloaded any time
13
+ # it changes. This slows down response time but is perfect for development
15
14
  # since you don't have to restart the web server when you make code changes.
16
15
  config.cache_classes = false
17
16
 
18
- config.assets.quiet = true
17
+ # Do not eager load code on boot.
18
+ config.eager_load = false
19
+
20
+ # Show full error reports.
21
+ config.consider_all_requests_local = true
22
+
23
+ # Enable server timing
24
+ config.server_timing = true
25
+
26
+ # Enable/disable caching. By default caching is disabled.
27
+ # Run rails dev:cache to toggle caching.
28
+ if Rails.root.join("tmp/caching-dev.txt").exist?
29
+ config.action_controller.perform_caching = true
30
+ config.action_controller.enable_fragment_cache_logging = true
31
+
32
+ config.cache_store = :memory_store
33
+ config.public_file_server.headers = {
34
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
35
+ }
36
+ else
37
+ config.action_controller.perform_caching = false
19
38
 
20
- # Show full error reports and disable caching
21
- config.consider_all_requests_local = true
22
- config.action_controller.perform_caching = false
39
+ config.cache_store = :null_store
40
+ end
41
+
42
+ # Store uploaded files on the local file system (see config/storage.yml for options).
43
+ config.active_storage.service = :local
23
44
 
24
45
  config.action_mailer.delivery_method = :file
25
46
  config.action_mailer.default_url_options = { host: 'localhost:3000' }
26
47
 
27
- # Don't care if the mailer can't send
48
+ # Don't care if the mailer can't send.
28
49
  config.action_mailer.raise_delivery_errors = false
29
50
 
30
- # Print deprecation notices to the Rails logger
51
+ # Print deprecation notices to the Rails logger.
31
52
  config.active_support.deprecation = :log
32
53
 
33
54
  # Only use best-standards-support built into browsers
34
55
  # config.action_dispatch.best_standards_support = :builtin
35
56
 
36
- # Raise an error on page load if there are pending migrations
57
+ # Raise an error on page load if there are pending migrations.
37
58
  config.active_record.migration_error = :page_load
38
59
 
60
+ # Highlight code that triggered database queries in logs.
61
+ config.active_record.verbose_query_logs = true
62
+
39
63
  # Expands the lines which load the assets
40
64
  config.assets.debug = true
41
65
 
@@ -43,6 +67,18 @@ if defined?(FatFreeCRM::Application)
43
67
  # yet still be able to expire them through the digest params.
44
68
  config.assets.digest = true
45
69
 
70
+ # Suppress logger output for asset requests.
71
+ config.assets.quiet = true
72
+
73
+ # Raises error for missing translations.
74
+ # config.i18n.raise_on_missing_translations = true
75
+
76
+ # Annotate rendered view with file names.
77
+ # config.action_view.annotate_rendered_view_with_filenames = true
78
+
79
+ # Uncomment if you wish to allow Action Cable access from any origin.
80
+ # config.action_cable.disable_request_forgery_protection = true
81
+
46
82
  # Adds additional error checking when serving assets at runtime.
47
83
  # Checks for improperly declared sprockets dependencies.
48
84
  # Raises helpful error messages.
@@ -7,15 +7,19 @@
7
7
  #------------------------------------------------------------------------------
8
8
  if defined?(FatFreeCRM::Application)
9
9
  FatFreeCRM::Application.configure do
10
- # Settings specified here will take precedence over those in config/application.rb
11
- config.eager_load = true
10
+ # Settings specified here will take precedence over those in config/application.rb.
12
11
 
13
- # Code is not reloaded between requests
12
+ # Code is not reloaded between requests.
14
13
  config.cache_classes = true
15
14
 
16
- # Full error reports are enabled, since this is an internal application.
15
+ # Eager load code on boot. This eager loads most of Rails and
16
+ # your application in memory, allowing both threaded web servers
17
+ # and those relying on copy on write to perform better.
18
+ # Rake tasks automatically ignore this option for performance.
19
+ config.eager_load = true
20
+
21
+ # Full error reports are disabled and caching is turned on.
17
22
  config.consider_all_requests_local = false
18
- # Caching is turned on
19
23
  config.action_controller.perform_caching = true
20
24
 
21
25
  # Disable Rails's static asset server (Apache or nginx will already do this)
@@ -24,29 +28,27 @@ if defined?(FatFreeCRM::Application)
24
28
  # Compress JavaScripts and CSS
25
29
  config.assets.compress = true
26
30
 
27
- # Don't fallback to assets pipeline if a precompiled asset is missed
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
28
32
  config.assets.compile = false
29
33
 
30
34
  # Generate digests for assets URLs
31
35
  config.assets.digest = true
32
36
 
33
- # Defaults to Rails.root.join("public/assets")
34
- # config.assets.manifest = YOUR_PATH
35
-
36
- # Specifies the header that your server uses for sending files
37
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
38
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
37
+ # Specifies the header that your server uses for sending files.
38
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
39
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
39
40
 
40
41
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
41
42
  # config.force_ssl = true
42
43
 
43
- # See everything in the log (default is :info)
44
+ # Include generic and useful information about system operation, but avoid logging too much
45
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
44
46
  config.log_level = :info
45
47
 
46
48
  # Use a different logger for distributed setups
47
49
  # config.logger = SyslogLogger.new
48
50
 
49
- # Use a different cache store in production
51
+ # Use a different cache store in production.
50
52
  # config.cache_store = :mem_cache_store
51
53
 
52
54
  # Enable serving of images, stylesheets, and JavaScripts from an asset server
@@ -56,7 +58,7 @@ if defined?(FatFreeCRM::Application)
56
58
  # config.assets.precompile += %w( search.js )
57
59
 
58
60
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
59
- # the I18n.default_locale when a translation can not be found)
61
+ # the I18n.default_locale when a translation cannot be found).
60
62
  config.i18n.fallbacks = true
61
63
 
62
64
  # Send deprecation notices to registered listeners
@@ -7,29 +7,33 @@
7
7
  #------------------------------------------------------------------------------
8
8
  if defined?(FatFreeCRM::Application)
9
9
  FatFreeCRM::Application.configure do
10
+ # Settings specified here will take precedence over those in config/application.rb.
11
+
10
12
  # The test environment is used exclusively to run your application's
11
13
  # test suite. You never need to work with it otherwise. Remember that
12
14
  # your test database is "scratch space" for the test suite and is wiped
13
15
  # and recreated between test runs. Don't rely on the data there!
16
+ # Turn false under Spring and add config.action_view.cache_template_loading = true.
14
17
  config.cache_classes = true
15
18
 
16
- # Do not eager load code on boot. This avoids loading your whole application
17
- # just for the purpose of running a single test. If you are using a tool that
18
- # preloads Rails for running tests, you may have to set it to true.
19
- config.eager_load = false
19
+ # Eager loading loads your whole application. When running a single test locally,
20
+ # this probably isn't necessary. It's a good idea to do in a continuous integration
21
+ # system, or in some way before deploying your code.
22
+ config.eager_load = ENV["CI"].present?
20
23
 
21
- # Configure static file server for tests with Cache-Control for performance.
24
+ # Configure public file server for tests with Cache-Control for performance.
22
25
  config.public_file_server.enabled = true
23
26
  config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
24
27
 
25
- # Show full error reports and disable caching
28
+ # Show full error reports and disable caching.
26
29
  config.consider_all_requests_local = true
27
30
  config.action_controller.perform_caching = false
31
+ config.cache_store = :null_store
28
32
 
29
- # Raise exceptions instead of rendering exception templates
33
+ # Raise exceptions instead of rendering exception templates.
30
34
  config.action_dispatch.show_exceptions = false
31
35
 
32
- # Disable request forgery protection in test environment
36
+ # Disable request forgery protection in test environment.
33
37
  config.action_controller.allow_forgery_protection = false
34
38
 
35
39
  # Tell Action Mailer not to deliver emails to the real world.
@@ -43,7 +47,7 @@ if defined?(FatFreeCRM::Application)
43
47
  # Randomize the order test cases are executed.
44
48
  config.active_support.test_order = :random
45
49
 
46
- # Print deprecation notices to the stderr
50
+ # Print deprecation notices to the stderr.
47
51
  config.active_support.deprecation = :stderr
48
52
 
49
53
  # Store uploaded files on the local file system in a temporary directory
@@ -52,6 +56,12 @@ if defined?(FatFreeCRM::Application)
52
56
  config.action_mailer.perform_caching = false
53
57
  # Raises error for missing translations
54
58
  # config.action_view.raise_on_missing_translations = true
59
+
60
+ # Raises error for missing translations.
61
+ # config.i18n.raise_on_missing_translations = true
62
+
63
+ # Annotate rendered view with file names.
64
+ # config.action_view.annotate_rendered_view_with_filenames = true
55
65
  end
56
66
 
57
67
  # Optionally load 'awesome_print' for debugging in development mode.
@@ -10,6 +10,7 @@
10
10
  # ActionMailer is setup in test mode later on
11
11
  #
12
12
  unless Rails.env.test?
13
+ require './app/models/setting'
13
14
 
14
15
  smtp_settings = Setting.smtp || {}
15
16