disco_app 0.15.2 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/clients/disco_app/graphql_client.rb +85 -0
- data/app/controllers/disco_app/flow/actions_controller.rb +7 -0
- data/app/controllers/disco_app/flow/concerns/actions_controller.rb +47 -0
- data/app/jobs/disco_app/flow/process_action_job.rb +11 -0
- data/app/jobs/disco_app/flow/process_trigger_job.rb +11 -0
- data/app/jobs/disco_app/shop_job.rb +8 -9
- data/app/models/disco_app/concerns/renders_assets.rb +1 -1
- data/app/models/disco_app/concerns/shop.rb +4 -5
- data/app/models/disco_app/flow/action.rb +7 -0
- data/app/models/disco_app/flow/concerns/action.rb +24 -0
- data/app/models/disco_app/flow/concerns/trigger.rb +24 -0
- data/app/models/disco_app/flow/trigger.rb +7 -0
- data/app/services/disco_app/flow/create_action.rb +35 -0
- data/app/services/disco_app/flow/create_trigger.rb +34 -0
- data/app/services/disco_app/flow/process_action.rb +50 -0
- data/app/services/disco_app/flow/process_trigger.rb +52 -0
- data/config/routes.rb +7 -1
- data/db/migrate/20150525000000_create_shops_if_not_existent.rb +80 -80
- data/db/migrate/20170315062548_create_disco_app_sources.rb +2 -0
- data/db/migrate/20170315062629_add_sources_to_shop_subscriptions.rb +2 -0
- data/db/migrate/20170327214540_create_disco_app_users.rb +2 -1
- data/db/migrate/20170606160751_fix_disco_app_users_index.rb +2 -0
- data/db/migrate/20181229100327_create_flow_actions_and_triggers.rb +32 -0
- data/lib/disco_app/configuration.rb +4 -0
- data/lib/disco_app/version.rb +1 -1
- data/lib/generators/disco_app/disco_app_generator.rb +24 -8
- data/lib/generators/disco_app/templates/config/appsignal.yml +12 -0
- data/lib/generators/disco_app/templates/config/cable.yml.tt +11 -0
- data/lib/generators/disco_app/templates/config/database.yml.tt +6 -3
- data/lib/generators/disco_app/templates/config/environments/staging.rb +108 -0
- data/lib/generators/disco_app/templates/config/newrelic.yml +3 -0
- data/lib/generators/disco_app/templates/controllers/home_controller.rb +1 -0
- data/lib/generators/disco_app/templates/initializers/session_store.rb +1 -1
- data/lib/generators/disco_app/templates/root/.env +3 -0
- data/lib/generators/disco_app/templates/root/.rubocop.yml +223 -158
- data/test/dummy/config/database.yml +3 -0
- data/test/dummy/config/environments/staging.rb +85 -0
- data/test/dummy/config/secrets.yml +3 -0
- data/test/dummy/db/schema.rb +39 -11
- data/test/services/disco_app/flow/create_action_test.rb +51 -0
- data/test/services/disco_app/flow/create_trigger_test.rb +56 -0
- data/test/services/disco_app/flow/process_action_test.rb +68 -0
- data/test/services/disco_app/flow/process_trigger_test.rb +61 -0
- data/test/vcr/flow_trigger_invalid_title.yml +35 -0
- data/test/vcr/flow_trigger_valid.yml +38 -0
- metadata +66 -11
- data/app/clients/disco_app/rollbar_client.rb +0 -53
- data/app/clients/disco_app/rollbar_client_error.rb +0 -2
- data/lib/generators/disco_app/templates/initializers/rollbar.rb +0 -23
- data/lib/tasks/rollbar.rake +0 -24
@@ -6,105 +6,105 @@ class CreateShopsIfNotExistent < ActiveRecord::Migration[5.1]
|
|
6
6
|
def change
|
7
7
|
return if table_exists? :disco_app_shops
|
8
8
|
|
9
|
-
create_table
|
10
|
-
t.datetime
|
11
|
-
t.datetime
|
9
|
+
create_table :disco_app_app_settings, force: :cascade do |t|
|
10
|
+
t.datetime :created_at, null: false
|
11
|
+
t.datetime :updated_at, null: false
|
12
12
|
end
|
13
13
|
|
14
|
-
create_table
|
15
|
-
t.integer
|
16
|
-
t.integer
|
17
|
-
t.integer
|
18
|
-
t.datetime
|
19
|
-
t.datetime
|
20
|
-
t.integer
|
21
|
-
t.string
|
14
|
+
create_table :disco_app_application_charges, force: :cascade do |t|
|
15
|
+
t.integer :shop_id, limit: 8
|
16
|
+
t.integer :subscription_id, limit: 8
|
17
|
+
t.integer :status, default: 0
|
18
|
+
t.datetime :created_at, null: false
|
19
|
+
t.datetime :updated_at, null: false
|
20
|
+
t.integer :shopify_id, limit: 8
|
21
|
+
t.string :confirmation_url
|
22
22
|
end
|
23
23
|
|
24
|
-
create_table
|
25
|
-
t.integer
|
26
|
-
t.string
|
27
|
-
t.integer
|
28
|
-
t.integer
|
29
|
-
t.datetime
|
30
|
-
t.datetime
|
31
|
-
t.integer
|
24
|
+
create_table :disco_app_plan_codes, force: :cascade do |t|
|
25
|
+
t.integer :plan_id, limit: 8
|
26
|
+
t.string :code
|
27
|
+
t.integer :trial_period_days
|
28
|
+
t.integer :amount
|
29
|
+
t.datetime :created_at, null: false
|
30
|
+
t.datetime :updated_at, null: false
|
31
|
+
t.integer :status, default: 0
|
32
32
|
end
|
33
33
|
|
34
|
-
create_table
|
35
|
-
t.integer
|
36
|
-
t.string
|
37
|
-
t.integer
|
38
|
-
t.integer
|
39
|
-
t.datetime
|
40
|
-
t.datetime
|
41
|
-
t.integer
|
42
|
-
t.string
|
43
|
-
t.integer
|
44
|
-
t.integer
|
34
|
+
create_table :disco_app_plans, force: :cascade do |t|
|
35
|
+
t.integer :status, default: 0
|
36
|
+
t.string :name
|
37
|
+
t.integer :plan_type, default: 0
|
38
|
+
t.integer :trial_period_days
|
39
|
+
t.datetime :created_at, null: false
|
40
|
+
t.datetime :updated_at, null: false
|
41
|
+
t.integer :amount, default: 0
|
42
|
+
t.string :currency, default: 'USD'
|
43
|
+
t.integer :interval, default: 0
|
44
|
+
t.integer :interval_count, default: 1
|
45
45
|
end
|
46
46
|
|
47
|
-
create_table
|
48
|
-
t.integer
|
49
|
-
t.integer
|
50
|
-
t.integer
|
51
|
-
t.datetime
|
52
|
-
t.datetime
|
53
|
-
t.integer
|
54
|
-
t.string
|
47
|
+
create_table :disco_app_recurring_application_charges, force: :cascade do |t|
|
48
|
+
t.integer :shop_id, limit: 8
|
49
|
+
t.integer :subscription_id, limit: 8
|
50
|
+
t.integer :status, default: 0
|
51
|
+
t.datetime :created_at, null: false
|
52
|
+
t.datetime :updated_at, null: false
|
53
|
+
t.integer :shopify_id, limit: 8
|
54
|
+
t.string :confirmation_url
|
55
55
|
end
|
56
56
|
|
57
|
-
create_table
|
58
|
-
t.string
|
59
|
-
t.text
|
60
|
-
t.datetime
|
61
|
-
t.datetime
|
62
|
-
t.integer
|
57
|
+
create_table :disco_app_sessions, force: :cascade do |t|
|
58
|
+
t.string :session_id, null: false
|
59
|
+
t.text :data
|
60
|
+
t.datetime :created_at, null: false
|
61
|
+
t.datetime :updated_at, null: false
|
62
|
+
t.integer :shop_id
|
63
63
|
end
|
64
64
|
|
65
|
-
add_index
|
66
|
-
add_index
|
65
|
+
add_index :disco_app_sessions, [:session_id], name: 'index_disco_app_sessions_on_session_id', unique: true, using: :btree
|
66
|
+
add_index :disco_app_sessions, [:updated_at], name: 'index_disco_app_sessions_on_updated_at', using: :btree
|
67
67
|
|
68
|
-
create_table
|
69
|
-
t.string
|
70
|
-
t.string
|
71
|
-
t.datetime
|
72
|
-
t.datetime
|
73
|
-
t.integer
|
74
|
-
t.string
|
75
|
-
t.string
|
76
|
-
t.string
|
77
|
-
t.jsonb
|
68
|
+
create_table :disco_app_shops, force: :cascade do |t|
|
69
|
+
t.string :shopify_domain, null: false
|
70
|
+
t.string :shopify_token, null: false
|
71
|
+
t.datetime :created_at, null: false
|
72
|
+
t.datetime :updated_at, null: false
|
73
|
+
t.integer :status, default: 0
|
74
|
+
t.string :domain
|
75
|
+
t.string :plan_name
|
76
|
+
t.string :name
|
77
|
+
t.jsonb :data, default: {}
|
78
78
|
end
|
79
79
|
|
80
|
-
add_index
|
80
|
+
add_index :disco_app_shops, [:shopify_domain], name: 'index_disco_app_shops_on_shopify_domain', unique: true, using: :btree
|
81
81
|
|
82
|
-
create_table
|
83
|
-
t.integer
|
84
|
-
t.integer
|
85
|
-
t.integer
|
86
|
-
t.integer
|
87
|
-
t.datetime
|
88
|
-
t.datetime
|
89
|
-
t.datetime
|
90
|
-
t.datetime
|
91
|
-
t.datetime
|
92
|
-
t.integer
|
93
|
-
t.integer
|
94
|
-
t.string
|
95
|
-
t.integer
|
82
|
+
create_table :disco_app_subscriptions, force: :cascade do |t|
|
83
|
+
t.integer :shop_id
|
84
|
+
t.integer :plan_id
|
85
|
+
t.integer :status
|
86
|
+
t.integer :subscription_type
|
87
|
+
t.datetime :created_at, null: false
|
88
|
+
t.datetime :updated_at, null: false
|
89
|
+
t.datetime :trial_start_at
|
90
|
+
t.datetime :trial_end_at
|
91
|
+
t.datetime :cancelled_at
|
92
|
+
t.integer :amount, default: 0
|
93
|
+
t.integer :plan_code_id, limit: 8
|
94
|
+
t.string :source
|
95
|
+
t.integer :trial_period_days
|
96
96
|
end
|
97
97
|
|
98
|
-
add_index
|
99
|
-
add_index
|
98
|
+
add_index :disco_app_subscriptions, [:plan_id], name: 'index_disco_app_subscriptions_on_plan_id', using: :btree
|
99
|
+
add_index :disco_app_subscriptions, [:shop_id], name: 'index_disco_app_subscriptions_on_shop_id', using: :btree
|
100
100
|
|
101
|
-
add_foreign_key
|
102
|
-
add_foreign_key
|
103
|
-
add_foreign_key
|
104
|
-
add_foreign_key
|
105
|
-
add_foreign_key
|
106
|
-
add_foreign_key
|
107
|
-
add_foreign_key
|
101
|
+
add_foreign_key :disco_app_application_charges, :disco_app_shops, column: :shop_id
|
102
|
+
add_foreign_key :disco_app_application_charges, :disco_app_subscriptions, column: :subscription_id
|
103
|
+
add_foreign_key :disco_app_plan_codes, :disco_app_plans, column: :plan_id
|
104
|
+
add_foreign_key :disco_app_recurring_application_charges, :disco_app_shops, column: :shop_id
|
105
|
+
add_foreign_key :disco_app_recurring_application_charges, :disco_app_subscriptions, column: :subscription_id
|
106
|
+
add_foreign_key :disco_app_sessions, :disco_app_shops, column: :shop_id, on_delete: :cascade
|
107
|
+
add_foreign_key :disco_app_subscriptions, :disco_app_plan_codes, column: :plan_code_id
|
108
108
|
end
|
109
109
|
|
110
110
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
class CreateDiscoAppSources < ActiveRecord::Migration[5.1]
|
2
|
+
|
2
3
|
def change
|
3
4
|
create_table :disco_app_sources do |t|
|
4
5
|
t.string :source, null: true
|
@@ -7,4 +8,5 @@ class CreateDiscoAppSources < ActiveRecord::Migration[5.1]
|
|
7
8
|
end
|
8
9
|
add_index :disco_app_sources, :source
|
9
10
|
end
|
11
|
+
|
10
12
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
class AddSourcesToShopSubscriptions < ActiveRecord::Migration[5.1]
|
2
|
+
|
2
3
|
def change
|
3
4
|
add_column :disco_app_subscriptions, :source_id, :integer, limit: 8, index: true
|
4
5
|
add_foreign_key :disco_app_subscriptions, :disco_app_sources, column: :source_id
|
@@ -11,4 +12,5 @@ class AddSourcesToShopSubscriptions < ActiveRecord::Migration[5.1]
|
|
11
12
|
|
12
13
|
remove_column :disco_app_subscriptions, :source
|
13
14
|
end
|
15
|
+
|
14
16
|
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
class CreateDiscoAppUsers < ActiveRecord::Migration[5.1]
|
2
|
+
|
2
3
|
def change
|
3
4
|
create_table :disco_app_users do |t|
|
4
5
|
t.integer :shop_id, limit: 8
|
5
6
|
t.string :first_name
|
6
7
|
t.string :last_name
|
7
8
|
t.string :email
|
8
|
-
|
9
9
|
t.timestamps null: false
|
10
10
|
end
|
11
11
|
add_index :disco_app_users, :shop_id, unique: true
|
12
12
|
end
|
13
|
+
|
13
14
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class CreateFlowActionsAndTriggers < ActiveRecord::Migration[5.2]
|
2
|
+
|
3
|
+
def change
|
4
|
+
create_table :disco_app_flow_actions do |t|
|
5
|
+
t.integer :shop_id, limit: 8
|
6
|
+
t.string :action_id
|
7
|
+
t.string :action_run_id
|
8
|
+
t.jsonb :properties, default: {}
|
9
|
+
t.integer :status, default: 0
|
10
|
+
t.datetime :processed_at, null: true
|
11
|
+
t.jsonb :processing_errors, default: []
|
12
|
+
t.timestamps null: false
|
13
|
+
end
|
14
|
+
|
15
|
+
create_table :disco_app_flow_triggers do |t|
|
16
|
+
t.integer :shop_id, limit: 8
|
17
|
+
t.string :title
|
18
|
+
t.string :resource_name
|
19
|
+
t.string :resource_url
|
20
|
+
t.jsonb :properties, default: {}
|
21
|
+
t.integer :status, default: 0
|
22
|
+
t.datetime :processed_at, null: true
|
23
|
+
t.jsonb :processing_errors, default: []
|
24
|
+
t.timestamps null: false
|
25
|
+
end
|
26
|
+
|
27
|
+
add_foreign_key :disco_app_flow_actions, :disco_app_shops, column: :shop_id, on_delete: :cascade
|
28
|
+
add_foreign_key :disco_app_flow_triggers, :disco_app_shops, column: :shop_id, on_delete: :cascade
|
29
|
+
add_index :disco_app_flow_actions, :action_run_id, unique: true
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -8,6 +8,10 @@ module DiscoApp
|
|
8
8
|
# Set the list of Shopify webhook topics to register.
|
9
9
|
attr_accessor :webhook_topics
|
10
10
|
|
11
|
+
# Set Flow configuration
|
12
|
+
attr_accessor :flow_actions
|
13
|
+
attr_accessor :flow_triggers
|
14
|
+
|
11
15
|
# Set the below if using an application proxy.
|
12
16
|
attr_accessor :app_proxy_prefix
|
13
17
|
|
data/lib/disco_app/version.rb
CHANGED
@@ -31,6 +31,7 @@ class DiscoAppGenerator < Rails::Generators::Base
|
|
31
31
|
|
32
32
|
# Add gem requirements.
|
33
33
|
gem 'active_link_to'
|
34
|
+
gem 'activeresource'
|
34
35
|
gem 'acts_as_singleton'
|
35
36
|
gem 'classnames-rails'
|
36
37
|
gem 'newrelic_rpm'
|
@@ -40,13 +41,12 @@ class DiscoAppGenerator < Rails::Generators::Base
|
|
40
41
|
gem 'premailer-rails'
|
41
42
|
gem 'react-rails'
|
42
43
|
gem 'render_anywhere'
|
43
|
-
gem '
|
44
|
+
gem 'appsignal'
|
44
45
|
gem 'shopify_app'
|
45
46
|
gem 'sidekiq'
|
46
|
-
gem 'activeresource'
|
47
47
|
|
48
|
-
# Indicate which gems should only be used in production.
|
49
|
-
gem_group :production do
|
48
|
+
# Indicate which gems should only be used in staging and production.
|
49
|
+
gem_group :staging, :production do
|
50
50
|
gem 'mailgun_rails'
|
51
51
|
gem 'rails_12factor'
|
52
52
|
end
|
@@ -54,9 +54,9 @@ class DiscoAppGenerator < Rails::Generators::Base
|
|
54
54
|
# Indicate which gems should only be used in development and test.
|
55
55
|
gem_group :development, :test do
|
56
56
|
gem 'dotenv-rails'
|
57
|
+
gem 'mechanize'
|
57
58
|
gem 'minitest-reporters'
|
58
59
|
gem 'webmock'
|
59
|
-
gem 'mechanize'
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -65,6 +65,10 @@ class DiscoAppGenerator < Rails::Generators::Base
|
|
65
65
|
template 'config/database.yml.tt'
|
66
66
|
end
|
67
67
|
|
68
|
+
def update_cable_config
|
69
|
+
template 'config/cable.yml.tt'
|
70
|
+
end
|
71
|
+
|
68
72
|
# Run bundle install to add our new gems before running tasks.
|
69
73
|
def bundle_install
|
70
74
|
Bundler.with_clean_env do
|
@@ -72,6 +76,10 @@ class DiscoAppGenerator < Rails::Generators::Base
|
|
72
76
|
end
|
73
77
|
end
|
74
78
|
|
79
|
+
def support_staging_environment
|
80
|
+
copy_file 'config/environments/staging.rb', 'config/environments/staging.rb'
|
81
|
+
end
|
82
|
+
|
75
83
|
# Make any required adjustments to the application configuration.
|
76
84
|
def configure_application
|
77
85
|
# The force_ssl flag is commented by default for production.
|
@@ -109,15 +117,23 @@ class DiscoAppGenerator < Rails::Generators::Base
|
|
109
117
|
application "config.active_job.queue_adapter = :sidekiq\n", env: :production
|
110
118
|
application "# Use Sidekiq as the active job backend", env: :production
|
111
119
|
|
120
|
+
# Set Sidekiq as the queue adapter in staging.
|
121
|
+
application "config.active_job.queue_adapter = :sidekiq\n", env: :staging
|
122
|
+
application "# Use Sidekiq as the active job backend", env: :staging
|
123
|
+
|
112
124
|
# Ensure the application configuration uses the DEFAULT_HOST environment
|
113
125
|
# variable to set up support for reverse routing absolute URLS (needed when
|
114
126
|
# generating Webhook URLs for example).
|
115
127
|
application "routes.default_url_options[:host] = ENV['DEFAULT_HOST']\n"
|
116
128
|
application "# Set the default host for absolute URL routing purposes"
|
117
129
|
|
118
|
-
# Configure React in development and production.
|
130
|
+
# Configure React in development, staging, and production.
|
119
131
|
application "config.react.variant = :development", env: :development
|
120
132
|
application "# Use development variant of React in development.", env: :development
|
133
|
+
|
134
|
+
application "config.react.variant = :production", env: :staging
|
135
|
+
application "# Use production variant of React in staging.", env: :staging
|
136
|
+
|
121
137
|
application "config.react.variant = :production", env: :production
|
122
138
|
application "# Use production variant of React in production.", env: :production
|
123
139
|
|
@@ -137,13 +153,13 @@ class DiscoAppGenerator < Rails::Generators::Base
|
|
137
153
|
end
|
138
154
|
CONFIG
|
139
155
|
application configuration, env: :production
|
156
|
+
application configuration, env: :staging
|
140
157
|
|
141
158
|
# Monitoring configuration
|
142
|
-
copy_file '
|
159
|
+
copy_file 'config/appsignal.yml', 'config/appsignal.yml'
|
143
160
|
copy_file 'config/newrelic.yml', 'config/newrelic.yml'
|
144
161
|
end
|
145
162
|
|
146
|
-
|
147
163
|
# Add entries to .env and .env.local
|
148
164
|
def add_env_variables
|
149
165
|
configuration = <<-CONFIG.strip_heredoc
|
@@ -0,0 +1,12 @@
|
|
1
|
+
default: &defaults
|
2
|
+
name: <%= ENV['SHOPIFY_APP_NAME'] || 'Unknown App' %>
|
3
|
+
push_api_key: <%= ENV['APPSIGNAL_PUSH_API_KEY'] %>
|
4
|
+
development:
|
5
|
+
<<: *defaults
|
6
|
+
active: false
|
7
|
+
staging:
|
8
|
+
<<: *defaults
|
9
|
+
active: true
|
10
|
+
production:
|
11
|
+
<<: *defaults
|
12
|
+
active: true
|
@@ -4,18 +4,21 @@ default: &default
|
|
4
4
|
pool: 5
|
5
5
|
timeout: 5000
|
6
6
|
prepared_statements: false
|
7
|
-
|
7
|
+
|
8
8
|
development:
|
9
9
|
<<: *default
|
10
10
|
host: localhost
|
11
11
|
port: 5432
|
12
12
|
database: <%= Rails.application.class.parent_name.downcase %>
|
13
|
-
|
13
|
+
|
14
14
|
test:
|
15
15
|
<<: *default
|
16
16
|
host: localhost
|
17
17
|
port: 5432
|
18
18
|
database: <%= Rails.application.class.parent_name.downcase %>_test
|
19
|
-
|
19
|
+
|
20
|
+
staging:
|
21
|
+
<<: *default
|
22
|
+
|
20
23
|
production:
|
21
24
|
<<: *default
|
@@ -0,0 +1,108 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Configure ActionMailer to use MailGun
|
3
|
+
if ENV['MAILGUN_API_KEY']
|
4
|
+
config.action_mailer.delivery_method = :mailgun
|
5
|
+
config.action_mailer.mailgun_settings = {
|
6
|
+
api_key: ENV['MAILGUN_API_KEY'],
|
7
|
+
domain: ENV['MAILGUN_API_DOMAIN']
|
8
|
+
}
|
9
|
+
end
|
10
|
+
|
11
|
+
# Use production variant of React in staging.
|
12
|
+
config.react.variant = :production
|
13
|
+
# Use Sidekiq as the active job backend
|
14
|
+
config.active_job.queue_adapter = :sidekiq
|
15
|
+
|
16
|
+
# Allow real charges in production with an ENV variable
|
17
|
+
config.x.shopify_charges_real = false
|
18
|
+
|
19
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
20
|
+
|
21
|
+
# Code is not reloaded between requests.
|
22
|
+
config.cache_classes = true
|
23
|
+
|
24
|
+
# Eager load code on boot. This eager loads most of Rails and
|
25
|
+
# your application in memory, allowing both threaded web servers
|
26
|
+
# and those relying on copy on write to perform better.
|
27
|
+
# Rake tasks automatically ignore this option for performance.
|
28
|
+
config.eager_load = true
|
29
|
+
|
30
|
+
# Full error reports are disabled and caching is turned on.
|
31
|
+
config.consider_all_requests_local = false
|
32
|
+
config.action_controller.perform_caching = true
|
33
|
+
|
34
|
+
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
|
35
|
+
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
|
36
|
+
# `config/secrets.yml.key`.
|
37
|
+
config.read_encrypted_secrets = true
|
38
|
+
|
39
|
+
# Disable serving static files from the `/public` folder by default since
|
40
|
+
# Apache or NGINX already handles this.
|
41
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
42
|
+
|
43
|
+
# Compress JavaScripts and CSS.
|
44
|
+
config.assets.js_compressor = :uglifier
|
45
|
+
# config.assets.css_compressor = :sass
|
46
|
+
|
47
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
48
|
+
config.assets.compile = false
|
49
|
+
|
50
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
51
|
+
|
52
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
53
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
54
|
+
|
55
|
+
# Specifies the header that your server uses for sending files.
|
56
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
57
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
58
|
+
|
59
|
+
# Mount Action Cable outside main process or domain
|
60
|
+
# config.action_cable.mount_path = nil
|
61
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
62
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
63
|
+
|
64
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
65
|
+
config.force_ssl = true
|
66
|
+
|
67
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
68
|
+
# when problems arise.
|
69
|
+
config.log_level = :debug
|
70
|
+
|
71
|
+
# Prepend all log lines with the following tags.
|
72
|
+
config.log_tags = [:request_id]
|
73
|
+
|
74
|
+
# Use a different cache store in staging.
|
75
|
+
# config.cache_store = :mem_cache_store
|
76
|
+
|
77
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
78
|
+
# config.active_job.queue_adapter = :resque
|
79
|
+
# config.active_job.queue_name_prefix = "example_app_#{Rails.env}"
|
80
|
+
config.action_mailer.perform_caching = false
|
81
|
+
|
82
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
83
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
84
|
+
# config.action_mailer.raise_delivery_errors = false
|
85
|
+
|
86
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
87
|
+
# the I18n.default_locale when a translation cannot be found).
|
88
|
+
config.i18n.fallbacks = true
|
89
|
+
|
90
|
+
# Send deprecation notices to registered listeners.
|
91
|
+
config.active_support.deprecation = :notify
|
92
|
+
|
93
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
94
|
+
config.log_formatter = ::Logger::Formatter.new
|
95
|
+
|
96
|
+
# Use a different logger for distributed setups.
|
97
|
+
# require 'syslog/logger'
|
98
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
99
|
+
|
100
|
+
if ENV['RAILS_LOG_TO_STDOUT'].present?
|
101
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
102
|
+
logger.formatter = config.log_formatter
|
103
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Do not dump schema after migrations.
|
107
|
+
config.active_record.dump_schema_after_migration = false
|
108
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# Use an ActiveRecord-based session store.
|
2
|
-
Rails.application.config.session_store :active_record_store, :
|
2
|
+
Rails.application.config.session_store :active_record_store, key: '_disco_app_session'
|