fat_free_crm 0.21.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/config/fat_free_crm.js +3 -0
- data/app/assets/config/manifest.js +1 -3
- data/app/assets/javascripts/application.js.erb +1 -0
- data/app/assets/javascripts/crm.js.coffee +6 -3
- data/app/assets/javascripts/crm_select2.js.coffee +4 -1
- data/app/assets/javascripts/crm_tags.js.coffee +4 -4
- data/app/assets/javascripts/crm_validations.js.coffee +12 -0
- data/app/assets/stylesheets/bootstrap-custom.scss +3 -3
- data/app/assets/stylesheets/common.scss +9 -0
- data/app/assets/stylesheets/rails.scss +1 -1
- data/app/controllers/admin/field_groups_controller.rb +0 -2
- data/app/controllers/admin/fields_controller.rb +16 -13
- 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 +3 -1
- data/app/controllers/home_controller.rb +2 -0
- data/app/controllers/lists_controller.rb +7 -4
- data/app/controllers/tasks_controller.rb +3 -1
- data/app/controllers/users_controller.rb +2 -0
- data/app/helpers/application_helper.rb +4 -4
- data/app/helpers/opportunities_helper.rb +4 -2
- data/app/helpers/users_helper.rb +1 -1
- data/app/models/entities/campaign.rb +2 -2
- data/app/models/fields/custom_field.rb +2 -2
- data/app/models/fields/custom_field_pair.rb +6 -7
- data/app/models/fields/field.rb +1 -3
- data/app/models/list.rb +1 -1
- data/app/models/observers/entity_observer.rb +1 -1
- data/app/models/polymorphic/comment.rb +1 -1
- data/app/models/setting.rb +4 -5
- data/app/models/users/user.rb +1 -1
- data/app/views/accounts/_contact_info.html.haml +1 -1
- data/app/views/accounts/_top_section.html.haml +3 -3
- data/app/views/accounts/show.js.haml +1 -1
- data/app/views/accounts/update.js.haml +1 -0
- data/app/views/admin/custom_fields/_check_boxes_field.html.haml +4 -1
- data/app/views/admin/custom_fields/_date_pair_field.html.haml +1 -1
- data/app/views/campaigns/_top_section.html.haml +2 -2
- data/app/views/campaigns/show.js.haml +1 -1
- data/app/views/campaigns/update.js.haml +1 -0
- data/app/views/contacts/_top_section.html.haml +5 -5
- data/app/views/contacts/show.js.haml +2 -3
- data/app/views/contacts/update.js.haml +1 -0
- data/app/views/devise/sessions/new.html.haml +4 -5
- data/app/views/fields/_group.html.haml +5 -2
- data/app/views/fields/_group_table.html.haml +4 -5
- data/app/views/fields/_group_view.html.haml +4 -1
- data/app/views/fields/_sidebar_show.html.haml +5 -8
- data/app/views/fields/group.js.erb +3 -1
- data/app/views/layouts/application.html.haml +1 -1
- data/app/views/leads/_top_section.html.haml +4 -4
- data/app/views/leads/show.js.haml +1 -1
- data/app/views/leads/update.js.haml +1 -0
- data/app/views/opportunities/_top_section.html.haml +2 -2
- data/app/views/opportunities/show.js.haml +1 -1
- data/app/views/opportunities/update.js.haml +1 -0
- data/app/views/shared/_add_comment.html.haml +1 -1
- data/app/views/shared/_address.html.haml +1 -1
- data/app/views/tasks/_top_section.html.haml +4 -4
- data/bin/bundle +108 -2
- data/bin/rails +3 -3
- data/bin/rake +2 -2
- data/bin/setup +12 -15
- data/config/application.rb +9 -4
- data/config/boot.rb +3 -5
- data/config/cable.yml +10 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +4 -3
- data/config/environments/development.rb +47 -14
- 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 +2 -1
- 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/settings.default.yml +2 -1
- data/config/storage.yml +5 -5
- data/db/demo/field_groups.yml +2 -1
- data/db/migrate/20230526212613_convert_to_active_storage.rb +27 -11
- data/db/schema.rb +107 -105
- data/lib/fat_free_crm/callback.rb +2 -3
- data/lib/fat_free_crm/custom_fields.rb +1 -0
- data/lib/fat_free_crm/mail_processor/dropbox.rb +1 -1
- data/lib/fat_free_crm/version.rb +2 -2
- metadata +43 -19
- data/config/initializers/new_framework_defaults_6_0.rb +0 -46
data/config/cable.yml
ADDED
data/config/database.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
development: &development
|
3
|
+
adapter: postgresql
|
4
|
+
database: fat_free_crm_development
|
5
|
+
username: postgres
|
6
|
+
password: postgres
|
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
|
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
|
19
25
|
|
20
|
-
#
|
21
|
-
|
22
|
-
|
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
|
38
|
+
|
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,12 +67,21 @@ 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.
|
49
85
|
config.assets.raise_runtime_errors = true
|
50
|
-
|
51
|
-
# Store files locally.
|
52
|
-
config.active_storage.service = :local
|
53
86
|
end
|
54
87
|
end
|
@@ -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.
|
@@ -1,31 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# Be sure to restart your server when you modify this file.
|
3
3
|
|
4
|
-
# Define an application-wide content security policy
|
5
|
-
#
|
6
|
-
# https://
|
4
|
+
# Define an application-wide content security policy.
|
5
|
+
# See the Securing Rails Applications Guide for more information:
|
6
|
+
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
7
7
|
|
8
|
-
# Rails.application.
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
|
18
|
-
#
|
19
|
-
#
|
8
|
+
# Rails.application.configure do
|
9
|
+
# config.content_security_policy do |policy|
|
10
|
+
# policy.default_src :self, :https
|
11
|
+
# policy.font_src :self, :https, :data
|
12
|
+
# policy.img_src :self, :https, :data
|
13
|
+
# policy.object_src :none
|
14
|
+
# policy.script_src :self, :https
|
15
|
+
# policy.style_src :self, :https
|
16
|
+
# # Specify URI for violation reports
|
17
|
+
# # policy.report_uri "/csp-violation-report-endpoint"
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# # Generate session nonces for permitted importmap and inline scripts
|
21
|
+
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
22
|
+
# config.content_security_policy_nonce_directives = %w(script-src)
|
23
|
+
#
|
24
|
+
# # Report violations without enforcing the policy.
|
25
|
+
# # config.content_security_policy_report_only = true
|
20
26
|
# end
|
21
|
-
|
22
|
-
# If you are using UJS then enable automatic nonce generation
|
23
|
-
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
24
|
-
|
25
|
-
# Set the nonce only to specific directives
|
26
|
-
# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
|
27
|
-
|
28
|
-
# Report CSP violations to a specified URI
|
29
|
-
# For further information see the following documentation:
|
30
|
-
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
31
|
-
# Rails.application.config.content_security_policy_report_only = true
|
@@ -6,7 +6,8 @@
|
|
6
6
|
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
7
7
|
#------------------------------------------------------------------------------
|
8
8
|
# Load field names for custom fields, for Ransack search
|
9
|
-
|
9
|
+
require 'setting'
|
10
|
+
if Setting.database_and_table_exists? && ActiveRecord::Base.connection.table_exists?(:custom_fields)
|
10
11
|
Rails.application.config.after_initialize do
|
11
12
|
I18n.backend.load_translations
|
12
13
|
|
@@ -2,5 +2,9 @@
|
|
2
2
|
|
3
3
|
# Be sure to restart your server when you modify this file.
|
4
4
|
|
5
|
-
# Configure
|
6
|
-
|
5
|
+
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
|
6
|
+
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
|
7
|
+
# notations and behaviors.
|
8
|
+
Rails.application.config.filter_parameters += %i[
|
9
|
+
passw secret token _key crypt salt certificate otp ssn
|
10
|
+
]
|
@@ -5,13 +5,13 @@
|
|
5
5
|
# are locale specific, and you may define rules for as many different
|
6
6
|
# locales as you wish. All of these examples are active by default:
|
7
7
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
8
|
-
# inflect.plural /^(ox)$/i,
|
9
|
-
# inflect.singular /^(ox)en/i,
|
10
|
-
# inflect.irregular
|
8
|
+
# inflect.plural /^(ox)$/i, "\\1en"
|
9
|
+
# inflect.singular /^(ox)en/i, "\\1"
|
10
|
+
# inflect.irregular "person", "people"
|
11
11
|
# inflect.uncountable %w( fish sheep )
|
12
12
|
# end
|
13
13
|
|
14
14
|
# These inflection rules are supported but not enabled by default:
|
15
15
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
16
|
-
# inflect.acronym
|
16
|
+
# inflect.acronym "RESTful"
|
17
17
|
# end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Define an application-wide HTTP permissions policy. For further
|
3
|
+
# information see https://developers.google.com/web/updates/2018/06/feature-policy
|
4
|
+
#
|
5
|
+
# Rails.application.config.permissions_policy do |f|
|
6
|
+
# f.camera :none
|
7
|
+
# f.gyroscope :none
|
8
|
+
# f.microphone :none
|
9
|
+
# f.usb :none
|
10
|
+
# f.fullscreen :self
|
11
|
+
# f.payment :self, "https://secure.example.com"
|
12
|
+
# end
|
data/config/settings.default.yml
CHANGED
@@ -192,7 +192,8 @@
|
|
192
192
|
#------------------------------------------------------------------------------
|
193
193
|
# Specify which countries (if any) should appear at the top of country pickers
|
194
194
|
# priority_countries:
|
195
|
-
# -
|
195
|
+
# - AU
|
196
|
+
# - BF
|
196
197
|
|
197
198
|
# Main and Admin Tabs
|
198
199
|
#------------------------------------------------------------------------------
|
data/config/storage.yml
CHANGED
@@ -6,27 +6,27 @@ local:
|
|
6
6
|
service: Disk
|
7
7
|
root: <%= Rails.root.join("storage") %>
|
8
8
|
|
9
|
-
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
9
|
+
# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
10
10
|
# amazon:
|
11
11
|
# service: S3
|
12
12
|
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
13
13
|
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
14
14
|
# region: us-east-1
|
15
|
-
# bucket: your_own_bucket
|
15
|
+
# bucket: your_own_bucket-<%= Rails.env %>
|
16
16
|
|
17
17
|
# Remember not to checkin your GCS keyfile to a repository
|
18
18
|
# google:
|
19
19
|
# service: GCS
|
20
20
|
# project: your_project
|
21
21
|
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
22
|
-
# bucket: your_own_bucket
|
22
|
+
# bucket: your_own_bucket-<%= Rails.env %>
|
23
23
|
|
24
|
-
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
24
|
+
# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
25
25
|
# microsoft:
|
26
26
|
# service: AzureStorage
|
27
27
|
# storage_account_name: your_account_name
|
28
28
|
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
29
|
-
# container: your_container_name
|
29
|
+
# container: your_container_name-<%= Rails.env %>
|
30
30
|
|
31
31
|
# mirror:
|
32
32
|
# service: Mirror
|
data/db/demo/field_groups.yml
CHANGED
@@ -15,17 +15,33 @@ class ConvertToActiveStorage < ActiveRecord::Migration[5.2]
|
|
15
15
|
'LASTVAL()'
|
16
16
|
end
|
17
17
|
|
18
|
-
ActiveRecord::Base.connection.raw_connection.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
18
|
+
ActiveRecord::Base.connection.raw_connection.then do |conn|
|
19
|
+
if conn.is_a?(::PG::Connection)
|
20
|
+
conn.prepare('active_storage_blobs', <<-SQL)
|
21
|
+
INSERT INTO active_storage_blobs (
|
22
|
+
key, filename, content_type, metadata, byte_size, checksum, created_at
|
23
|
+
) VALUES ($1, $2, $3, '{}', $4, $5, $6)
|
24
|
+
SQL
|
25
|
+
|
26
|
+
conn.prepare('active_storage_attachments', <<-SQL)
|
27
|
+
INSERT INTO active_storage_attachments (
|
28
|
+
name, record_type, record_id, blob_id, created_at
|
29
|
+
) VALUES ($1, $2, $3, #{get_blob_id}, $4)
|
30
|
+
SQL
|
31
|
+
else
|
32
|
+
conn.raw_connection.prepare(<<-SQL)
|
33
|
+
INSERT INTO active_storage_blobs (
|
34
|
+
`key`, filename, content_type, metadata, byte_size, checksum, created_at
|
35
|
+
) VALUES (?, ?, ?, '{}', ?, ?, ?)
|
36
|
+
SQL
|
37
|
+
|
38
|
+
conn.raw_connection.prepare(<<-SQL)
|
39
|
+
INSERT INTO active_storage_attachments (
|
40
|
+
name, record_type, record_id, blob_id, created_at
|
41
|
+
) VALUES (?, ?, ?, #{get_blob_id}, ?)
|
42
|
+
SQL
|
43
|
+
end
|
44
|
+
end
|
29
45
|
|
30
46
|
Rails.application.eager_load!
|
31
47
|
models = ActiveRecord::Base.descendants.reject { |model| model.abstract_class? || model == ActionMailbox::InboundEmail || model == ActionText::RichText }
|