solidus_drip 0.0.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.
- checksums.yaml +7 -0
- data/LICENSE +26 -0
- data/README.md +55 -0
- data/Rakefile +32 -0
- data/app/assets/javascripts/spree/frontend/solidus_drip.js.erb +11 -0
- data/app/decorators/models/solidus_drip/spree/order_decorator.rb +47 -0
- data/app/decorators/models/solidus_drip/spree/variant_decorator.rb +25 -0
- data/config/initializers/default_host.rb +9 -0
- data/config/initializers/update_hooks.rb +3 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +5 -0
- data/lib/generators/solidus_drip/install/install_generator.rb +28 -0
- data/lib/solidus_drip.rb +9 -0
- data/lib/solidus_drip/base.rb +31 -0
- data/lib/solidus_drip/engine.rb +22 -0
- data/lib/solidus_drip/factories.rb +8 -0
- data/lib/solidus_drip/shopper_activity.rb +6 -0
- data/lib/solidus_drip/shopper_activity/order.rb +138 -0
- data/lib/solidus_drip/shopper_activity/product.rb +54 -0
- data/lib/solidus_drip/version.rb +5 -0
- data/spec/dummy/README.md +24 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/javascript/channels/consumer.js +6 -0
- data/spec/dummy/app/javascript/channels/index.js +5 -0
- data/spec/dummy/app/javascript/packs/application.js +17 -0
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/credentials.yml.enc +1 -0
- data/spec/dummy/config/database.yml +12 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +62 -0
- data/spec/dummy/config/environments/production.rb +112 -0
- data/spec/dummy/config/environments/test.rb +33 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +30 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/spree.rb +71 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/master.key +1 -0
- data/spec/dummy/config/routes.rb +9 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/db/migrate/20191101230305_create_active_storage_tables.active_storage.rb +27 -0
- data/spec/dummy/db/migrate/20191101230306_create_action_mailbox_tables.action_mailbox.rb +14 -0
- data/spec/dummy/db/migrate/20191101230307_create_action_text_tables.action_text.rb +14 -0
- data/spec/dummy/db/migrate/20191101230308_solidus_one_four.spree.rb +1103 -0
- data/spec/dummy/db/migrate/20191101230309_create_spree_wallet_payment_sources.spree.rb +28 -0
- data/spec/dummy/db/migrate/20191101230310_migrate_credit_cards_to_wallet_payment_sources.spree.rb +30 -0
- data/spec/dummy/db/migrate/20191101230311_remove_is_default_from_prices.spree.rb +8 -0
- data/spec/dummy/db/migrate/20191101230312_remove_currency_from_line_items.spree.rb +8 -0
- data/spec/dummy/db/migrate/20191101230313_add_available_to_columns_and_remove_display_on_from_payment_methods.spree.rb +31 -0
- data/spec/dummy/db/migrate/20191101230314_create_spree_promotion_code_batch.spree.rb +39 -0
- data/spec/dummy/db/migrate/20191101230315_add_available_to_users_and_remove_display_on_from_shipping_methods.spree.rb +23 -0
- data/spec/dummy/db/migrate/20191101230316_add_index_to_spree_payments_number.spree.rb +8 -0
- data/spec/dummy/db/migrate/20191101230317_remove_spree_store_credits_column.spree.rb +8 -0
- data/spec/dummy/db/migrate/20191101230318_add_lft_and_rgt_indexes_to_taxons.spree.rb +9 -0
- data/spec/dummy/db/migrate/20191101230319_remove_order_id_from_inventory_units.spree.rb +31 -0
- data/spec/dummy/db/migrate/20191101230320_transform_tax_rate_category_relation.spree.rb +51 -0
- data/spec/dummy/db/migrate/20191101230321_add_roles_unique_constraints.spree.rb +9 -0
- data/spec/dummy/db/migrate/20191101230322_add_time_range_to_tax_rate.spree.rb +9 -0
- data/spec/dummy/db/migrate/20191101230323_rename_bogus_gateways.spree.rb +19 -0
- data/spec/dummy/db/migrate/20191101230324_remove_default_tax_from_spree_zones.spree.rb +8 -0
- data/spec/dummy/db/migrate/20191101230325_create_promotion_rule_stores.spree.rb +13 -0
- data/spec/dummy/db/migrate/20191101230326_create_store_shipping_methods.spree.rb +13 -0
- data/spec/dummy/db/migrate/20191101230327_add_available_locales_to_stores.spree.rb +10 -0
- data/spec/dummy/db/migrate/20191101230328_add_amount_remaining_to_store_credit_events.spree.rb +62 -0
- data/spec/dummy/db/migrate/20191101230329_add_join_characters_to_promotion_code_batch.spree.rb +12 -0
- data/spec/dummy/db/migrate/20191101230330_create_spree_store_credit_reasons_table.spree.rb +56 -0
- data/spec/dummy/db/migrate/20191101230331_remove_code_from_spree_promotions.spree.rb +43 -0
- data/spec/dummy/db/migrate/20191101230332_drop_spree_store_credit_update_reasons.spree.rb +20 -0
- data/spec/dummy/db/migrate/20191101230333_add_api_key_to_spree_users.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20191101230334_resize_api_key_field.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20191101230335_rename_api_key_to_spree_api_key.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20191101230336_add_index_to_user_spree_api_key.spree_api.rb +10 -0
- data/spec/dummy/db/migrate/20191101230337_create_users.solidus_auth.rb +32 -0
- data/spec/dummy/db/migrate/20191101230338_rename_columns_for_devise.solidus_auth.rb +40 -0
- data/spec/dummy/db/migrate/20191101230339_convert_user_remember_field.solidus_auth.rb +14 -0
- data/spec/dummy/db/migrate/20191101230340_add_reset_password_sent_at_to_spree_users.solidus_auth.rb +11 -0
- data/spec/dummy/db/migrate/20191101230341_make_users_email_index_unique.solidus_auth.rb +12 -0
- data/spec/dummy/db/migrate/20191101230342_add_deleted_at_to_users.solidus_auth.rb +9 -0
- data/spec/dummy/db/migrate/20191101230343_add_confirmable_to_users.solidus_auth.rb +10 -0
- data/spec/dummy/db/migrate/20191101230344_add_reset_password_token_index_to_spree_users.solidus_auth.rb +35 -0
- data/spec/dummy/db/schema.rb +1211 -0
- data/spec/dummy/db/seeds.rb +10 -0
- data/spec/dummy/db/solidus_test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +12695 -0
- data/spec/dummy/package.json +11 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/development_secret.txt +1 -0
- data/spec/dummy/vendor/assets/javascripts/spree/backend/all.js +11 -0
- data/spec/dummy/vendor/assets/javascripts/spree/frontend/all.js +11 -0
- data/spec/dummy/vendor/assets/stylesheets/spree/backend/all.css +10 -0
- data/spec/dummy/vendor/assets/stylesheets/spree/frontend/all.css +10 -0
- data/spec/models/order_spec.rb +45 -0
- data/spec/models/variant_spec.rb +27 -0
- data/spec/spec_helper.rb +34 -0
- data/spec/support/stub_drip_responses.rb +13 -0
- metadata +495 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SolidusDrip
|
|
4
|
+
module ShopperActivity
|
|
5
|
+
class Product < SolidusDrip::Base
|
|
6
|
+
attr_accessor :variant
|
|
7
|
+
|
|
8
|
+
##
|
|
9
|
+
# ShopperActivity::Product relies on Spree::Variant data to be useful.
|
|
10
|
+
# We call super to initialize the client and then we set the variant
|
|
11
|
+
# attribute to be used in the API calls.
|
|
12
|
+
#
|
|
13
|
+
# @param variant [Spree::Variant] the variant to be recorded
|
|
14
|
+
#
|
|
15
|
+
def initialize(variant)
|
|
16
|
+
super
|
|
17
|
+
@variant = variant
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
##
|
|
21
|
+
# Product Activity helps identify variant updates.
|
|
22
|
+
#
|
|
23
|
+
# @param action [String] the product action, `created`, `updated`, or `deleted`
|
|
24
|
+
# @see https://developer.drip.com/#product-activity
|
|
25
|
+
#
|
|
26
|
+
def product_activity(action)
|
|
27
|
+
response = client.create_product_activity_event(product_data(action))
|
|
28
|
+
handle_error_response(response) if !response.success?
|
|
29
|
+
|
|
30
|
+
response.success?
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
##
|
|
36
|
+
# Formats data to be used in Drip product calls
|
|
37
|
+
#
|
|
38
|
+
def product_data(action)
|
|
39
|
+
{
|
|
40
|
+
provider: 'solidus',
|
|
41
|
+
action: action,
|
|
42
|
+
product_id: variant.product_id.to_s,
|
|
43
|
+
product_variant_id: variant.id.to_s,
|
|
44
|
+
sku: variant.sku,
|
|
45
|
+
name: variant.name,
|
|
46
|
+
categories: variant.product.taxons.pluck(:name),
|
|
47
|
+
price: variant.price.to_f,
|
|
48
|
+
inventory: variant.total_on_hand,
|
|
49
|
+
product_url: product_url(variant.product)
|
|
50
|
+
}.compact
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# README
|
|
2
|
+
|
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
|
4
|
+
application up and running.
|
|
5
|
+
|
|
6
|
+
Things you may want to cover:
|
|
7
|
+
|
|
8
|
+
* Ruby version
|
|
9
|
+
|
|
10
|
+
* System dependencies
|
|
11
|
+
|
|
12
|
+
* Configuration
|
|
13
|
+
|
|
14
|
+
* Database creation
|
|
15
|
+
|
|
16
|
+
* Database initialization
|
|
17
|
+
|
|
18
|
+
* How to run the test suite
|
|
19
|
+
|
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
|
21
|
+
|
|
22
|
+
* Deployment instructions
|
|
23
|
+
|
|
24
|
+
* ...
|
data/spec/dummy/Rakefile
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
+
* listed below.
|
|
4
|
+
*
|
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
|
|
6
|
+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
+
*
|
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
|
11
|
+
* It is generally better to create a new file per style scope.
|
|
12
|
+
*
|
|
13
|
+
*= require_tree .
|
|
14
|
+
*= require_self
|
|
15
|
+
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Action Cable provides the framework to deal with WebSockets in Rails.
|
|
2
|
+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
|
3
|
+
|
|
4
|
+
import { createConsumer } from "@rails/actioncable"
|
|
5
|
+
|
|
6
|
+
export default createConsumer()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file is automatically compiled by Webpack, along with any other files
|
|
2
|
+
// present in this directory. You're encouraged to place your actual application logic in
|
|
3
|
+
// a relevant structure within app/javascript and only use these pack files to reference
|
|
4
|
+
// that code so it'll be compiled.
|
|
5
|
+
|
|
6
|
+
require("@rails/ujs").start()
|
|
7
|
+
require("turbolinks").start()
|
|
8
|
+
require("@rails/activestorage").start()
|
|
9
|
+
require("channels")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// Uncomment to copy all static images under ../images to the output folder and reference
|
|
13
|
+
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
|
|
14
|
+
// or the `imagePath` JavaScript helper below.
|
|
15
|
+
//
|
|
16
|
+
// const images = require.context('../images', true)
|
|
17
|
+
// const imagePath = (name) => images(name, true)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
class ApplicationJob < ActiveJob::Base
|
|
2
|
+
# Automatically retry jobs that encountered a deadlock
|
|
3
|
+
# retry_on ActiveRecord::Deadlocked
|
|
4
|
+
|
|
5
|
+
# Most jobs are safe to ignore if the underlying records are no longer available
|
|
6
|
+
# discard_on ActiveJob::DeserializationError
|
|
7
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Dummy</title>
|
|
5
|
+
<%= csrf_meta_tags %>
|
|
6
|
+
<%= csp_meta_tag %>
|
|
7
|
+
|
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
|
9
|
+
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<%= yield %>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= yield %>
|
data/spec/dummy/bin/rake
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'fileutils'
|
|
3
|
+
|
|
4
|
+
# path to your application root.
|
|
5
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
|
6
|
+
|
|
7
|
+
def system!(*args)
|
|
8
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
FileUtils.chdir APP_ROOT do
|
|
12
|
+
# This script is a way to setup or update your development environment automatically.
|
|
13
|
+
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
|
14
|
+
# Add necessary setup steps to this file.
|
|
15
|
+
|
|
16
|
+
puts '== Installing dependencies =='
|
|
17
|
+
system! 'gem install bundler --conservative'
|
|
18
|
+
system('bundle check') || system!('bundle install')
|
|
19
|
+
|
|
20
|
+
# Install JavaScript dependencies
|
|
21
|
+
# system('bin/yarn')
|
|
22
|
+
|
|
23
|
+
# puts "\n== Copying sample files =="
|
|
24
|
+
# unless File.exist?('config/database.yml')
|
|
25
|
+
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
|
26
|
+
# end
|
|
27
|
+
|
|
28
|
+
puts "\n== Preparing database =="
|
|
29
|
+
system! 'bin/rails db:prepare'
|
|
30
|
+
|
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
33
|
+
|
|
34
|
+
puts "\n== Restarting application server =="
|
|
35
|
+
system! 'bin/rails restart'
|
|
36
|
+
end
|
data/spec/dummy/bin/yarn
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
|
3
|
+
Dir.chdir(APP_ROOT) do
|
|
4
|
+
begin
|
|
5
|
+
exec "yarnpkg", *ARGV
|
|
6
|
+
rescue Errno::ENOENT
|
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
|
9
|
+
exit 1
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'rails/all'
|
|
4
|
+
|
|
5
|
+
Bundler.require(*Rails.groups(assets: %w(development test)))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
begin
|
|
9
|
+
require 'spree_frontend'
|
|
10
|
+
rescue LoadError
|
|
11
|
+
# spree_frontend is not available.
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
begin
|
|
15
|
+
require 'spree_backend'
|
|
16
|
+
rescue LoadError
|
|
17
|
+
# spree_backend is not available.
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
begin
|
|
21
|
+
require 'spree_api'
|
|
22
|
+
rescue LoadError
|
|
23
|
+
# spree_api is not available.
|
|
24
|
+
end
|
|
25
|
+
require 'solidus_drip'
|
|
26
|
+
|
|
27
|
+
module Dummy
|
|
28
|
+
class Application < Rails::Application
|
|
29
|
+
# Load application's model / class decorators
|
|
30
|
+
initializer 'spree.decorators' do |app|
|
|
31
|
+
config.to_prepare do
|
|
32
|
+
Dir.glob(Rails.root.join('app/**/*_decorator*.rb')) do |path|
|
|
33
|
+
require_dependency(path)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Load application's view overrides
|
|
39
|
+
initializer 'spree.overrides' do |app|
|
|
40
|
+
config.to_prepare do
|
|
41
|
+
Dir.glob(Rails.root.join('app/overrides/*.rb')) do |path|
|
|
42
|
+
require_dependency(path)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
# Initialize configuration defaults for originally generated Rails version.
|
|
47
|
+
config.load_defaults 6.0
|
|
48
|
+
|
|
49
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
50
|
+
# Application configuration can go into files in config/initializers
|
|
51
|
+
# -- all .rb files in that directory are automatically loaded after loading
|
|
52
|
+
# the framework and any gems in your application.
|
|
53
|
+
|
|
54
|
+
# Don't generate system test files.
|
|
55
|
+
config.generators.system_tests = nil
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
wAel1wmXXQIj3os2jdlH8HLLhJpdTqS3tUkeSXQLqyujP9XMKYRdpnAGxrgGEayLVEtlT3WJQTsiNlgPW3PZnj/aocWGqZaFLe4Dxd1JKnuBzTYNQke+c+RL2SXTEwKgOdDPbejNH8cJNP4cN9nBuaoKR8ldjpUiyyTbPG/Ez/aGnQtbAEdaTR8YBRGY0cGI1b4NwkQqW0Hnj/p2TB7IPETxEZJwFePx9f/K2hNyZLiZjMILs1u90ziaDqQ9JM212PT1gbbVeUw9n3hbnxvVnMjSRcdWTX7QYmBeSpY/1H44hnHXnc1h07c6AFQOxPJC9k2svhq23U9B1P1inF0SHSSnD1oCSv5Oktlq+VQB6KgGMxUD7/gHglILBCD+5wl5AoRYqpkcK3sa61/e9cUyGv8V+KPFLlWOV1ay--pqPdh4N3u2HuTebT--DUklSkCxlJiEqidp4ztBeQ==
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Rails.application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
|
+
|
|
4
|
+
# In the development environment your application's code is reloaded on
|
|
5
|
+
# every request. This slows down response time but is perfect for development
|
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
|
7
|
+
config.cache_classes = false
|
|
8
|
+
|
|
9
|
+
# Do not eager load code on boot.
|
|
10
|
+
config.eager_load = false
|
|
11
|
+
|
|
12
|
+
# Show full error reports.
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
|
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
|
16
|
+
# Run rails dev:cache to toggle caching.
|
|
17
|
+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
|
18
|
+
config.action_controller.perform_caching = true
|
|
19
|
+
config.action_controller.enable_fragment_cache_logging = true
|
|
20
|
+
|
|
21
|
+
config.cache_store = :memory_store
|
|
22
|
+
config.public_file_server.headers = {
|
|
23
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
|
24
|
+
}
|
|
25
|
+
else
|
|
26
|
+
config.action_controller.perform_caching = false
|
|
27
|
+
|
|
28
|
+
config.cache_store = :null_store
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
|
32
|
+
config.active_storage.service = :local
|
|
33
|
+
|
|
34
|
+
# Don't care if the mailer can't send.
|
|
35
|
+
config.action_mailer.raise_delivery_errors = false
|
|
36
|
+
|
|
37
|
+
config.action_mailer.perform_caching = false
|
|
38
|
+
|
|
39
|
+
# Print deprecation notices to the Rails logger.
|
|
40
|
+
config.active_support.deprecation = :log
|
|
41
|
+
|
|
42
|
+
# Raise an error on page load if there are pending migrations.
|
|
43
|
+
config.active_record.migration_error = :page_load
|
|
44
|
+
|
|
45
|
+
# Highlight code that triggered database queries in logs.
|
|
46
|
+
config.active_record.verbose_query_logs = true
|
|
47
|
+
|
|
48
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
|
49
|
+
# This option may cause significant delays in view rendering with a large
|
|
50
|
+
# number of complex assets.
|
|
51
|
+
config.assets.debug = true
|
|
52
|
+
|
|
53
|
+
# Suppress logger output for asset requests.
|
|
54
|
+
config.assets.quiet = true
|
|
55
|
+
|
|
56
|
+
# Raises error for missing translations.
|
|
57
|
+
# config.action_view.raise_on_missing_translations = true
|
|
58
|
+
|
|
59
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
60
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
|
61
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
62
|
+
end
|