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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +170 -0
- data/README.md +3 -6
- data/app/assets/config/fat_free_crm.js +3 -0
- data/app/assets/config/manifest.js +1 -0
- data/app/controllers/admin/field_groups_controller.rb +0 -2
- data/app/controllers/admin/tags_controller.rb +1 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/controllers/application_controller.rb +11 -0
- data/app/controllers/comments_controller.rb +2 -0
- data/app/controllers/emails_controller.rb +2 -0
- data/app/controllers/entities/accounts_controller.rb +3 -1
- data/app/controllers/entities/campaigns_controller.rb +3 -1
- data/app/controllers/entities/contacts_controller.rb +3 -1
- data/app/controllers/entities/leads_controller.rb +4 -2
- data/app/controllers/entities/opportunities_controller.rb +3 -1
- data/app/controllers/entities_controller.rb +2 -0
- data/app/controllers/home_controller.rb +2 -0
- data/app/controllers/lists_controller.rb +2 -0
- data/app/controllers/tasks_controller.rb +3 -1
- data/app/controllers/users_controller.rb +2 -0
- data/app/helpers/accounts_helper.rb +2 -0
- data/app/helpers/application_helper.rb +22 -3
- data/app/helpers/tasks_helper.rb +1 -2
- data/app/models/entities/account.rb +1 -1
- data/app/models/entities/campaign.rb +1 -1
- data/app/models/entities/contact.rb +1 -1
- data/app/models/entities/lead.rb +1 -1
- data/app/models/entities/opportunity.rb +1 -1
- data/app/models/fields/custom_field.rb +2 -2
- data/app/models/observers/entity_observer.rb +1 -1
- data/app/models/polymorphic/avatar.rb +1 -30
- data/app/models/polymorphic/comment.rb +1 -1
- data/app/models/polymorphic/task.rb +1 -0
- data/app/models/setting.rb +4 -5
- data/app/models/users/user.rb +1 -1
- data/app/views/home/index.xls.builder +1 -0
- data/app/views/shared/_address.html.haml +1 -1
- data/bin/bundle +108 -2
- data/bin/rails +3 -3
- data/bin/rake +2 -2
- data/bin/setup +12 -15
- data/config/application.rb +22 -4
- data/config/boot.rb +3 -5
- data/config/cable.yml +10 -0
- data/config/database.yml +26 -0
- data/config/environment.rb +4 -3
- data/config/environments/development.rb +47 -11
- data/config/environments/production.rb +17 -15
- data/config/environments/test.rb +19 -9
- data/config/initializers/action_mailer.rb +1 -0
- data/config/initializers/content_security_policy.rb +21 -26
- data/config/initializers/custom_field_ransack_translations.rb +1 -0
- data/config/initializers/filter_parameter_logging.rb +6 -2
- data/config/initializers/inflections.rb +4 -4
- data/config/initializers/permissions_policy.rb +12 -0
- data/config/puma.rb +2 -2
- data/config/storage.yml +34 -0
- data/db/demo/field_groups.yml +2 -1
- data/db/migrate/20100928030617_drop_openid_tables.rb +2 -1
- data/db/migrate/20230526211831_create_active_storage_tables.active_storage.rb +51 -0
- data/db/migrate/20230526212613_convert_to_active_storage.rb +107 -0
- data/db/schema.rb +108 -76
- data/db/seeds/fields.rb +7 -21
- data/lib/development_tasks/license.rake +10 -10
- data/lib/fat_free_crm/callback.rb +2 -3
- data/lib/fat_free_crm/errors.rb +2 -10
- data/lib/fat_free_crm/exceptions.rb +1 -0
- data/lib/fat_free_crm/fields.rb +4 -5
- data/lib/fat_free_crm/gem_dependencies.rb +0 -1
- data/lib/fat_free_crm/i18n.rb +1 -1
- data/lib/fat_free_crm/mail_processor/dropbox.rb +1 -1
- data/lib/fat_free_crm/version.rb +3 -3
- data/public/avatars/User/2/large_rails.png +0 -0
- data/public/avatars/User/2/medium_rails.png +0 -0
- data/public/avatars/User/2/small_rails.png +0 -0
- data/public/avatars/User/2/thumb_rails.png +0 -0
- data/public/avatars/User/3/large_rails.png +0 -0
- data/public/avatars/User/3/medium_rails.png +0 -0
- data/public/avatars/User/3/original_rails.png +0 -0
- data/public/avatars/User/3/small_rails.png +0 -0
- data/public/avatars/User/3/thumb_rails.png +0 -0
- data/public/avatars/User/4/large_rails.png +0 -0
- data/public/avatars/User/4/medium_rails.png +0 -0
- data/public/avatars/User/4/original_rails.png +0 -0
- data/public/avatars/User/4/small_rails.png +0 -0
- data/public/avatars/User/4/thumb_rails.png +0 -0
- data/public/avatars/User/6/large_rails.png +0 -0
- data/public/avatars/User/6/medium_rails.png +0 -0
- data/public/avatars/User/6/original_rails.png +0 -0
- data/public/avatars/User/6/small_rails.png +0 -0
- data/public/avatars/User/6/thumb_rails.png +0 -0
- data/public/avatars/User/7/large_rails.png +0 -0
- data/public/avatars/User/7/medium_rails.png +0 -0
- data/public/avatars/User/7/original_rails.png +0 -0
- data/public/avatars/User/7/small_rails.png +0 -0
- data/public/avatars/User/7/thumb_rails.png +0 -0
- metadata +73 -288
- data/.docker/nginx/sites-enabled/ffcrm.conf +0 -8
- data/.github/workflows/brakeman-analysis.yml +0 -46
- data/.github/workflows/rubocop-analysis.yml +0 -40
- data/.github/workflows/ruby.yml +0 -52
- data/.gitignore +0 -39
- data/.rubocop.yml +0 -73
- data/.rubocop_todo.yml +0 -286
- data/.teatro.yml +0 -3
- data/.travis.yml +0 -60
- data/CONTRIBUTORS.md +0 -135
- data/Capfile +0 -27
- data/Dockerfile +0 -51
- data/Gemfile +0 -106
- data/Gemfile.lock +0 -529
- data/Guardfile +0 -26
- data/Procfile +0 -1
- data/SECURITY.md +0 -11
- data/Vagrantfile +0 -92
- data/config/initializers/new_framework_defaults_6_0.rb +0 -46
- data/custom_plan.rb +0 -11
- data/docker-compose.yml +0 -27
- data/fat_free_crm.gemspec +0 -62
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/.gitkeep~master +0 -0
- data/script/rails +0 -8
- data/spec/controllers/admin/groups_controller_spec.rb +0 -11
- data/spec/controllers/admin/users_controller_spec.rb +0 -251
- data/spec/controllers/applications_controller_spec.rb +0 -43
- data/spec/controllers/comments_controller_spec.rb +0 -195
- data/spec/controllers/emails_controller_spec.rb +0 -37
- data/spec/controllers/entities/accounts_controller_spec.rb +0 -607
- data/spec/controllers/entities/campaigns_controller_spec.rb +0 -645
- data/spec/controllers/entities/contacts_controller_spec.rb +0 -705
- data/spec/controllers/entities/leads_controller_spec.rb +0 -1009
- data/spec/controllers/entities/opportunities_controller_spec.rb +0 -904
- data/spec/controllers/entities_controller_spec.rb +0 -47
- data/spec/controllers/home_controller_spec.rb +0 -235
- data/spec/controllers/lists_controller_spec.rb +0 -11
- data/spec/controllers/tasks_controller_spec.rb +0 -517
- data/spec/controllers/users_controller_spec.rb +0 -375
- data/spec/factories/account_factories.rb +0 -40
- data/spec/factories/campaign_factories.rb +0 -30
- data/spec/factories/contact_factories.rb +0 -45
- data/spec/factories/field_factories.rb +0 -40
- data/spec/factories/lead_factories.rb +0 -36
- data/spec/factories/list_factories.rb +0 -13
- data/spec/factories/opportunity_factories.rb +0 -39
- data/spec/factories/sequences.rb +0 -32
- data/spec/factories/setting_factories.rb +0 -15
- data/spec/factories/shared_factories.rb +0 -70
- data/spec/factories/subscription_factories.rb +0 -13
- data/spec/factories/tag_factories.rb +0 -12
- data/spec/factories/task_factories.rb +0 -29
- data/spec/factories/user_factories.rb +0 -66
- data/spec/features/acceptance_helper.rb +0 -11
- data/spec/features/accounts_spec.rb +0 -126
- data/spec/features/admin/groups_spec.rb +0 -31
- data/spec/features/admin/users_spec.rb +0 -40
- data/spec/features/campaigns_spec.rb +0 -104
- data/spec/features/contacts_spec.rb +0 -134
- data/spec/features/dashboard_spec.rb +0 -67
- data/spec/features/devise/sign_in_spec.rb +0 -58
- data/spec/features/devise/sign_up_spec.rb +0 -36
- data/spec/features/leads_spec.rb +0 -138
- data/spec/features/opportunities_overview_spec.rb +0 -88
- data/spec/features/opportunities_spec.rb +0 -132
- data/spec/features/support/autocomlete_helper.rb +0 -17
- data/spec/features/support/browser.rb +0 -28
- data/spec/features/support/headless.rb +0 -19
- data/spec/features/support/paths.rb +0 -48
- data/spec/features/support/selector_helpers.rb +0 -36
- data/spec/features/tasks_spec.rb +0 -94
- data/spec/helpers/accounts_helper_spec.rb +0 -73
- data/spec/helpers/admin/field_groups_helper_spec.rb +0 -20
- data/spec/helpers/admin/plugins_helper_spec.rb +0 -11
- data/spec/helpers/admin/settings_helper_spec.rb +0 -11
- data/spec/helpers/admin/users_helper_spec.rb +0 -11
- data/spec/helpers/application_helper_spec.rb +0 -86
- data/spec/helpers/authentications_helper_spec.rb +0 -16
- data/spec/helpers/campaigns_helper_spec.rb +0 -16
- data/spec/helpers/comments_helper_spec.rb +0 -16
- data/spec/helpers/contacts_helper_spec.rb +0 -16
- data/spec/helpers/emails_helper_spec.rb +0 -11
- data/spec/helpers/fields_helper_spec.rb +0 -12
- data/spec/helpers/groups_helper_spec.rb +0 -21
- data/spec/helpers/home_helper_spec.rb +0 -16
- data/spec/helpers/leads_helper_spec.rb +0 -16
- data/spec/helpers/lists_helper_spec.rb +0 -21
- data/spec/helpers/opportunities_helper_spec.rb +0 -16
- data/spec/helpers/passwords_helper_spec.rb +0 -16
- data/spec/helpers/tasks_helper_spec.rb +0 -20
- data/spec/helpers/users_helper_spec.rb +0 -39
- data/spec/lib/comment_extensions_spec.rb +0 -42
- data/spec/lib/core_ext/string_spec.rb +0 -23
- data/spec/lib/errors_spec.rb +0 -32
- data/spec/lib/fields_spec.rb +0 -101
- data/spec/lib/mail_processor/base_spec.rb +0 -169
- data/spec/lib/mail_processor/comment_replies_spec.rb +0 -70
- data/spec/lib/mail_processor/dropbox_spec.rb +0 -306
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +0 -173
- data/spec/lib/permissions_spec.rb +0 -155
- data/spec/lib/secret_token_generator_spec.rb +0 -69
- data/spec/lib/view_factory_spec.rb +0 -69
- data/spec/mailers/devise_mailer_spec.rb +0 -35
- data/spec/mailers/subscription_mailer_spec.rb +0 -48
- data/spec/mailers/user_mailer_spec.rb +0 -115
- data/spec/models/entities/account_contact_spec.rb +0 -34
- data/spec/models/entities/account_opportunity_spec.rb +0 -34
- data/spec/models/entities/account_spec.rb +0 -206
- data/spec/models/entities/campaign_spec.rb +0 -131
- data/spec/models/entities/contact_opportunity_spec.rb +0 -34
- data/spec/models/entities/contact_spec.rb +0 -314
- data/spec/models/entities/lead_spec.rb +0 -102
- data/spec/models/entities/opportunity_spec.rb +0 -299
- data/spec/models/fields/custom_field_date_pair_spec.rb +0 -92
- data/spec/models/fields/custom_field_pair_spec.rb +0 -76
- data/spec/models/fields/custom_field_spec.rb +0 -129
- data/spec/models/fields/field_group_spec.rb +0 -29
- data/spec/models/fields/field_spec.rb +0 -69
- data/spec/models/list_spec.rb +0 -19
- data/spec/models/observers/entity_observer_spec.rb +0 -74
- data/spec/models/polymorphic/address_spec.rb +0 -34
- data/spec/models/polymorphic/avatar_spec.rb +0 -46
- data/spec/models/polymorphic/comment_spec.rb +0 -45
- data/spec/models/polymorphic/email_spec.rb +0 -53
- data/spec/models/polymorphic/task_spec.rb +0 -395
- data/spec/models/polymorphic/version_spec.rb +0 -241
- data/spec/models/setting_spec.rb +0 -77
- data/spec/models/users/abilities/user_ability_spec.rb +0 -70
- data/spec/models/users/group_spec.rb +0 -11
- data/spec/models/users/permission_spec.rb +0 -58
- data/spec/models/users/preference_spec.rb +0 -71
- data/spec/models/users/user_spec.rb +0 -238
- data/spec/routing/accounts_routing_spec.rb +0 -60
- data/spec/routing/admin/users_routing_spec.rb +0 -40
- data/spec/routing/campaigns_routing_spec.rb +0 -64
- data/spec/routing/comments_routing_spec.rb +0 -32
- data/spec/routing/contacts_routing_spec.rb +0 -60
- data/spec/routing/emails_routing_spec.rb +0 -40
- data/spec/routing/leads_routing_spec.rb +0 -88
- data/spec/routing/opportunities_routing_spec.rb +0 -64
- data/spec/routing/tasks_routing_spec.rb +0 -68
- data/spec/routing/users_routing_spec.rb +0 -106
- data/spec/shared/controllers.rb +0 -99
- data/spec/shared/models.rb +0 -141
- data/spec/spec_helper.rb +0 -117
- data/spec/support/assert_select.rb +0 -167
- data/spec/support/devise_helpers.rb +0 -28
- data/spec/support/feature_helpers.rb +0 -32
- data/spec/support/macros.rb +0 -49
- data/spec/support/mail_processor_mocks.rb +0 -37
- data/spec/support/uploaded_file.rb +0 -10
- data/spec/views/accounts/_edit.haml_spec.rb +0 -43
- data/spec/views/accounts/_new.haml_spec.rb +0 -42
- data/spec/views/accounts/create.js.haml_spec.rb +0 -52
- data/spec/views/accounts/destroy.js.haml_spec.rb +0 -34
- data/spec/views/accounts/edit.js.haml_spec.rb +0 -66
- data/spec/views/accounts/index.haml_spec.rb +0 -43
- data/spec/views/accounts/index.js.haml_spec.rb +0 -34
- data/spec/views/accounts/new.js.haml_spec.rb +0 -44
- data/spec/views/accounts/show.haml_spec.rb +0 -38
- data/spec/views/accounts/update.js.haml_spec.rb +0 -93
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -30
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +0 -31
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +0 -24
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +0 -25
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -29
- data/spec/views/admin/users/_create.haml_spec.rb +0 -23
- data/spec/views/admin/users/create.js.haml_spec.rb +0 -41
- data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -47
- data/spec/views/admin/users/edit.js.haml_spec.rb +0 -44
- data/spec/views/admin/users/index.haml_spec.rb +0 -22
- data/spec/views/admin/users/index.js.haml_spec.rb +0 -26
- data/spec/views/admin/users/new.js.haml_spec.rb +0 -34
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +0 -22
- data/spec/views/admin/users/show.haml_spec.rb +0 -18
- data/spec/views/admin/users/suspend.js.haml_spec.rb +0 -22
- data/spec/views/admin/users/update.js.haml_spec.rb +0 -37
- data/spec/views/application/auto_complete.haml_spec.rb +0 -48
- data/spec/views/campaigns/_edit.haml_spec.rb +0 -44
- data/spec/views/campaigns/_new.haml_spec.rb +0 -41
- data/spec/views/campaigns/create.js.haml_spec.rb +0 -49
- data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -31
- data/spec/views/campaigns/edit.js.haml_spec.rb +0 -66
- data/spec/views/campaigns/index.haml_spec.rb +0 -37
- data/spec/views/campaigns/index.js.haml_spec.rb +0 -34
- data/spec/views/campaigns/new.js.haml_spec.rb +0 -50
- data/spec/views/campaigns/show.haml_spec.rb +0 -38
- data/spec/views/campaigns/update.js.haml_spec.rb +0 -78
- data/spec/views/comments/edit.js.haml_spec.rb +0 -30
- data/spec/views/contacts/_edit.haml_spec.rb +0 -73
- data/spec/views/contacts/_new.haml_spec.rb +0 -52
- data/spec/views/contacts/create.js.haml_spec.rb +0 -65
- data/spec/views/contacts/destroy.js.haml_spec.rb +0 -45
- data/spec/views/contacts/edit.js.haml_spec.rb +0 -74
- data/spec/views/contacts/index.haml_spec.rb +0 -37
- data/spec/views/contacts/index.js.html_spec.rb +0 -34
- data/spec/views/contacts/new.js.haml_spec.rb +0 -47
- data/spec/views/contacts/show.haml_spec.rb +0 -35
- data/spec/views/contacts/update.js.haml_spec.rb +0 -128
- data/spec/views/home/index.haml_spec.rb +0 -36
- data/spec/views/home/index.js.haml_spec.rb +0 -33
- data/spec/views/home/options.js.haml_spec.rb +0 -53
- data/spec/views/leads/_convert.haml_spec.rb +0 -30
- data/spec/views/leads/_edit.haml_spec.rb +0 -47
- data/spec/views/leads/_new.haml_spec.rb +0 -45
- data/spec/views/leads/_sidebar_show.haml_spec.rb +0 -31
- data/spec/views/leads/convert.js.haml_spec.rb +0 -79
- data/spec/views/leads/create.js.haml_spec.rb +0 -67
- data/spec/views/leads/destroy.js.haml_spec.rb +0 -47
- data/spec/views/leads/edit.js.haml_spec.rb +0 -76
- data/spec/views/leads/index.haml_spec.rb +0 -37
- data/spec/views/leads/index.js.haml_spec.rb +0 -34
- data/spec/views/leads/new.js.haml_spec.rb +0 -47
- data/spec/views/leads/promote.js.haml_spec.rb +0 -135
- data/spec/views/leads/reject.js.haml_spec.rb +0 -45
- data/spec/views/leads/show.haml_spec.rb +0 -32
- data/spec/views/leads/update.js.haml_spec.rb +0 -118
- data/spec/views/opportunities/_edit.haml_spec.rb +0 -70
- data/spec/views/opportunities/_new.haml_spec.rb +0 -51
- data/spec/views/opportunities/create.js.haml_spec.rb +0 -86
- data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -64
- data/spec/views/opportunities/edit.js.haml_spec.rb +0 -75
- data/spec/views/opportunities/index.haml_spec.rb +0 -38
- data/spec/views/opportunities/index.js.haml_spec.rb +0 -35
- data/spec/views/opportunities/new.js.haml_spec.rb +0 -54
- data/spec/views/opportunities/show.haml_spec.rb +0 -35
- data/spec/views/opportunities/update.js.haml_spec.rb +0 -143
- data/spec/views/tasks/_edit.haml_spec.rb +0 -50
- data/spec/views/tasks/complete.js.haml_spec.rb +0 -67
- data/spec/views/tasks/create.js.haml_spec.rb +0 -119
- data/spec/views/tasks/destroy.js.haml_spec.rb +0 -57
- data/spec/views/tasks/edit.js.haml_spec.rb +0 -76
- data/spec/views/tasks/index.haml_spec.rb +0 -46
- data/spec/views/tasks/new.js.haml_spec.rb +0 -49
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -45
- data/spec/views/tasks/update.js.haml_spec.rb +0 -140
- data/spec/views/users/avatar.js.haml_spec.rb +0 -35
- data/spec/views/users/change_password.js.haml_spec.rb +0 -51
- data/spec/views/users/edit.js.haml_spec.rb +0 -35
- data/spec/views/users/password.js.haml_spec.rb +0 -36
- data/spec/views/users/update.js.haml_spec.rb +0 -46
- data/spec/views/users/upload_avatar.js.haml_spec.rb +0 -45
- data/vendor/gems/globby-0.1.2/LICENSE.txt +0 -20
- data/vendor/gems/globby-0.1.2/README.md +0 -65
- data/vendor/gems/globby-0.1.2/Rakefile +0 -9
- data/vendor/gems/globby-0.1.2/lib/globby/glob.rb +0 -90
- data/vendor/gems/globby-0.1.2/lib/globby/globject.rb +0 -18
- data/vendor/gems/globby-0.1.2/lib/globby/result.rb +0 -20
- data/vendor/gems/globby-0.1.2/lib/globby.rb +0 -47
- data/vendor/gems/globby-0.1.2/spec/gitignore_spec.rb +0 -109
- data/vendor/gems/globby-0.1.2/spec/globby_spec.rb +0 -93
- data/zeus.json +0 -22
- /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
|
-
|
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).
|
57
|
+
SubscriptionMailer.comment_notification(subscriber, self).deliver_later
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/app/models/setting.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
data/app/models/users/user.rb
CHANGED
@@ -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
|
|
@@ -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,
|
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
|
-
|
5
|
-
|
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(
|
5
|
-
require_relative
|
6
|
-
require
|
4
|
+
APP_PATH = File.expand_path("../config/application", __dir__)
|
5
|
+
require_relative "../config/boot"
|
6
|
+
require "rails/commands"
|
data/bin/rake
CHANGED
data/bin/setup
CHANGED
@@ -1,38 +1,35 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require
|
4
|
+
require "fileutils"
|
5
5
|
|
6
6
|
# path to your application root.
|
7
|
-
APP_ROOT = File.expand_path(
|
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
|
15
|
-
# This script is idempotent, so that you can run it at
|
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
|
19
|
-
system!
|
20
|
-
system(
|
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?(
|
27
|
-
# FileUtils.cp
|
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!
|
28
|
+
system! "bin/rails db:prepare"
|
32
29
|
|
33
30
|
puts "\n== Removing old logs and tempfiles =="
|
34
|
-
system!
|
31
|
+
system! "bin/rails log:clear tmp:clear"
|
35
32
|
|
36
33
|
puts "\n== Restarting application server =="
|
37
|
-
system!
|
34
|
+
system! "bin/rails restart"
|
38
35
|
end
|
data/config/application.rb
CHANGED
@@ -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
|
33
|
+
config.load_defaults 7.0
|
33
34
|
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
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
|
-
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
9
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
11
10
|
|
12
|
-
require
|
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
data/config/database.yml
ADDED
@@ -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
|
+
|
data/config/environment.rb
CHANGED
@@ -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
|
-
#
|
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
|
14
|
-
#
|
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
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
34
|
-
# config.
|
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
|
-
#
|
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
|
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
|
data/config/environments/test.rb
CHANGED
@@ -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
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
config.eager_load =
|
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
|
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.
|