workarea-product_videos 1.2.2
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/.editorconfig +16 -0
- data/.eslintrc +27 -0
- data/.gitignore +19 -0
- data/.rails-rubocop.yml +119 -0
- data/.rubocop.yml +7 -0
- data/.scss-lint.yml +192 -0
- data/CHANGELOG.md +92 -0
- data/Gemfile +16 -0
- data/README.md +87 -0
- data/Rakefile +60 -0
- data/app/assets/images/workarea/admin/icons/video.svg +1 -0
- data/app/assets/images/workarea/storefront/icons/video_play.svg +1 -0
- data/app/assets/javascripts/workarea/storefront/product_videos/modules/vimeo_api.js +81 -0
- data/app/assets/javascripts/workarea/storefront/product_videos/modules/youtube_api.js +124 -0
- data/app/assets/stylesheets/workarea/storefront/product_videos/components/_product_video.scss +37 -0
- data/app/controllers/workarea/admin/catalog_product_videos_controller.rb +52 -0
- data/app/controllers/workarea/storefront/products_controller.decorator +19 -0
- data/app/models/workarea/catalog/product.decorator +7 -0
- data/app/models/workarea/catalog/product_video.rb +32 -0
- data/app/services/workarea/video_embed_parser.rb +54 -0
- data/app/view_models/workarea/storefront/product_video_view_model.rb +84 -0
- data/app/view_models/workarea/storefront/product_view_model.decorator +9 -0
- data/app/views/workarea/admin/catalog_product_videos/edit.html.haml +76 -0
- data/app/views/workarea/admin/catalog_product_videos/index.html.haml +46 -0
- data/app/views/workarea/admin/catalog_product_videos/new.html.haml +57 -0
- data/app/views/workarea/admin/catalog_products/_product_videos_card.html.haml +21 -0
- data/app/views/workarea/storefront/products/_video_link.html.haml +8 -0
- data/app/views/workarea/storefront/products/_video_thumbnail.html.haml +12 -0
- data/app/views/workarea/storefront/products/video.html.haml +3 -0
- data/bin/rails +20 -0
- data/config/initializers/appends.rb +37 -0
- data/config/initializers/product_videos.rb +5 -0
- data/config/initializers/workarea.rb +3 -0
- data/config/locales/en.yml +41 -0
- data/config/routes.rb +15 -0
- data/lib/workarea/product_videos/engine.rb +8 -0
- data/lib/workarea/product_videos/version.rb +5 -0
- data/lib/workarea/product_videos.rb +11 -0
- data/script/admin_ci +9 -0
- data/script/ci +11 -0
- data/script/core_ci +9 -0
- data/script/plugins_ci +9 -0
- data/script/storefront_ci +9 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +38 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config/application.rb +29 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +54 -0
- data/test/dummy/config/environments/production.rb +91 -0
- data/test/dummy/config/environments/test.rb +44 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +14 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/new_framework_defaults.rb +23 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/workarea.rb +5 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +33 -0
- data/test/dummy/config/puma.rb +56 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/secrets.yml +32 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/package.json +5 -0
- data/test/factories/embed_codes.rb +15 -0
- data/test/integration/workarea/admin/product_videos_integration_test.rb +59 -0
- data/test/integration/workarea/storefront/product_videos_integration_test.rb +30 -0
- data/test/services/workarea/video_embedder_test.rb +27 -0
- data/test/system/workarea/admin/product_videos_system_test.rb +58 -0
- data/test/system/workarea/storefront/product_videos_system_test.rb +60 -0
- data/test/teaspoon_env.rb +6 -0
- data/test/test_helper.rb +10 -0
- data/test/view_models/workarea/storefront/product_video_view_model_test.rb +46 -0
- data/workarea-product_videos.gemspec +19 -0
- metadata +157 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.grid__cell
|
|
2
|
+
.card{ class: card_classes(:videos, local_assigns[:active]) }
|
|
3
|
+
= link_to catalog_product_videos_path(model), class: 'card__header' do
|
|
4
|
+
%span.card__header-text= t('workarea.admin.catalog_products.cards.videos.title')
|
|
5
|
+
= inline_svg 'workarea/admin/icons/video.svg', class: 'card__icon'
|
|
6
|
+
- if local_assigns[:active].blank?
|
|
7
|
+
.card__body
|
|
8
|
+
- if @product.videos.count < 1
|
|
9
|
+
%p.card__empty-note= t('workarea.admin.catalog_products.cards.videos.no_videos')
|
|
10
|
+
|
|
11
|
+
= link_to new_catalog_product_video_path(model), class: 'card__button' do
|
|
12
|
+
%span.button.button--small= t('workarea.admin.catalog_products.cards.videos.add_button')
|
|
13
|
+
- else
|
|
14
|
+
%ul.list-reset
|
|
15
|
+
- @product.videos.each do |video|
|
|
16
|
+
%li
|
|
17
|
+
%strong Embed ID
|
|
18
|
+
= video[:embed_id]
|
|
19
|
+
|
|
20
|
+
= link_to catalog_product_videos_path(model), class: 'card__button' do
|
|
21
|
+
%span.button.button--small= t('workarea.admin.catalog_products.cards.videos.manage_button')
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
- if @product.videos.present?
|
|
2
|
+
- @product.videos.each do |video|
|
|
3
|
+
.product-video
|
|
4
|
+
- if video.display_option == 'dialog'
|
|
5
|
+
= link_to t('workarea.storefront.products.watch_this_video'), product_video_path(@product.id, video.id), data: { dialog_button: { dialogOptions: { uiDialogOptions: { dialogClass: 'ui-dialog-video' } } } }, class: "product-video__dialog-link"
|
|
6
|
+
- elsif video.display_option == 'embedded'
|
|
7
|
+
.product-video__container
|
|
8
|
+
%iframe.product-video__iframe{ video.iframe_attrs }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
- if product.videos.present?
|
|
2
|
+
- product.videos.each do |video|
|
|
3
|
+
- if video.display_option == 'thumbnail'
|
|
4
|
+
.grid__cell
|
|
5
|
+
.product-details__alt-image
|
|
6
|
+
= link_to(product_video_path(product.id, video.id), class: 'product-details__alt-image-link', target: '_blank', rel: 'noopener', data: { dialog_button: { dialog_options: { ui_dialog_options: { dialog_class: 'ui-dialog-video' } } }.to_json }) do
|
|
7
|
+
.product-video.product-video--thumbnail
|
|
8
|
+
= inline_svg('workarea/storefront/icons/video_play.svg', class: 'svg-icon product-video__play-icon', title: t('workarea.storefront.products.watch_this_video'))
|
|
9
|
+
- if video.thumbnail.present?
|
|
10
|
+
= image_tag(video.thumbnail.process(:small_thumb).url, alt: t('workarea.storefront.products.watch_this_video'), class: 'product-video__thumbnail')
|
|
11
|
+
- else
|
|
12
|
+
= image_tag(product_image_url(product.images.first, :small_thumb), alt: t('workarea.storefront.products.watch_this_video'), class: 'product-video__thumbnail')
|
data/bin/rails
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
|
3
|
+
# installed from the root of your application.
|
|
4
|
+
|
|
5
|
+
ENGINE_ROOT = File.expand_path("../..", __FILE__)
|
|
6
|
+
ENGINE_PATH = File.expand_path("../../lib/product_videos/engine", __FILE__)
|
|
7
|
+
APP_PATH = File.expand_path("../../test/dummy/config/application", __FILE__)
|
|
8
|
+
|
|
9
|
+
# Set up gems listed in the Gemfile.
|
|
10
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
|
|
11
|
+
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
|
12
|
+
|
|
13
|
+
require "action_controller/railtie"
|
|
14
|
+
require "action_view/railtie"
|
|
15
|
+
require "action_mailer/railtie"
|
|
16
|
+
require "rails/test_unit/railtie"
|
|
17
|
+
require "sprockets/railtie"
|
|
18
|
+
require "teaspoon-mocha"
|
|
19
|
+
|
|
20
|
+
require "rails/engine/commands"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Workarea
|
|
2
|
+
should_append_video_api_modules = proc do
|
|
3
|
+
if Plugin.javascripts_appends["storefront.modules"].nil?
|
|
4
|
+
true
|
|
5
|
+
else
|
|
6
|
+
Plugin.javascripts_appends["storefront.modules"].none? { |append| %r{/modules/youtube_api} =~ append }
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
Plugin.append_partials(
|
|
11
|
+
"admin.catalog_product_cards",
|
|
12
|
+
"workarea/admin/catalog_products/product_videos_card"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
Plugin.append_partials(
|
|
16
|
+
"storefront.product_description",
|
|
17
|
+
"workarea/storefront/products/video_link"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
Plugin.append_partials(
|
|
21
|
+
"storefront.product_details_alt_images",
|
|
22
|
+
"workarea/storefront/products/video_thumbnail"
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if should_append_video_api_modules.call
|
|
26
|
+
Plugin.append_javascripts(
|
|
27
|
+
"storefront.modules",
|
|
28
|
+
"workarea/storefront/product_videos/modules/youtube_api",
|
|
29
|
+
"workarea/storefront/product_videos/modules/vimeo_api"
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
Plugin.append_stylesheets(
|
|
34
|
+
"storefront.components",
|
|
35
|
+
"workarea/storefront/product_videos/components/product_video",
|
|
36
|
+
)
|
|
37
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
en:
|
|
2
|
+
workarea:
|
|
3
|
+
admin:
|
|
4
|
+
catalog_product_videos:
|
|
5
|
+
edit:
|
|
6
|
+
extracted_data: Extracted Data
|
|
7
|
+
heading: Edit Video
|
|
8
|
+
title: Edit Video for %{product}
|
|
9
|
+
update_button: Save changes
|
|
10
|
+
fields:
|
|
11
|
+
aspect_ratio: Aspect Ratio
|
|
12
|
+
display_type: Display Type
|
|
13
|
+
display_type_info_html: "<p><strong>Embedded:</strong> Embeds the video directly on the detail page.</p> <p><strong>Dialog:</strong> Opens the video in a dialog</p> <p><strong>Thumbnail:</strong> Adds thumbnail to alternate images, video plays in dialog when thumbnail is clicked. If no thumbnail is provided the primary product image will be used.</p>"
|
|
14
|
+
embed_code: Embed Code
|
|
15
|
+
host: Host
|
|
16
|
+
thumbnail: Thumbnail
|
|
17
|
+
url: URL
|
|
18
|
+
video_id: Embed ID
|
|
19
|
+
flash_messages:
|
|
20
|
+
created: Your video has been added.
|
|
21
|
+
deleted: Your video has been removed.
|
|
22
|
+
error: Your video was not saved.
|
|
23
|
+
updated: Your video has been updated.
|
|
24
|
+
index:
|
|
25
|
+
add_new: Add New
|
|
26
|
+
heading: Manage Videos
|
|
27
|
+
title: Manage Videos for %{product}
|
|
28
|
+
new:
|
|
29
|
+
button: Add video
|
|
30
|
+
heading: New Video
|
|
31
|
+
title: New Video for %{product}
|
|
32
|
+
catalog_products:
|
|
33
|
+
cards:
|
|
34
|
+
videos:
|
|
35
|
+
add_button: Add a Video
|
|
36
|
+
manage_button: Manage Videos
|
|
37
|
+
no_videos: This product has no videos.
|
|
38
|
+
title: Videos
|
|
39
|
+
storefront:
|
|
40
|
+
products:
|
|
41
|
+
watch_this_video: Watch this video
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Workarea::Storefront::Engine.routes.draw do
|
|
2
|
+
scope "(:locale)", constraints: Workarea::I18n.routes_constraint do
|
|
3
|
+
resources :products, only: [:show] do
|
|
4
|
+
get "video/:video_id", to: "products#video", as: :video
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
Workarea::Admin::Engine.routes.draw do
|
|
10
|
+
scope "(:locale)", constraints: Workarea::I18n.routes_constraint do
|
|
11
|
+
resources :catalog_products, only: [:index] do
|
|
12
|
+
resources :videos, controller: "catalog_product_videos"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/script/admin_ci
ADDED
data/script/ci
ADDED
data/script/core_ci
ADDED
data/script/plugins_ci
ADDED
data/test/dummy/Rakefile
ADDED
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
+
// listed below.
|
|
3
|
+
//
|
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
|
6
|
+
//
|
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
|
9
|
+
//
|
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
|
11
|
+
// about supported directives.
|
|
12
|
+
//
|
|
13
|
+
//= require_tree .
|
|
@@ -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, vendor/assets/stylesheets,
|
|
6
|
+
* or any plugin's 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
|
+
*/
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= yield %>
|
data/test/dummy/bin/rake
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'pathname'
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
include FileUtils
|
|
5
|
+
|
|
6
|
+
# path to your application root.
|
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
|
8
|
+
|
|
9
|
+
def system!(*args)
|
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
chdir APP_ROOT do
|
|
14
|
+
# This script is a starting point to setup your application.
|
|
15
|
+
# Add necessary setup steps to this file.
|
|
16
|
+
|
|
17
|
+
puts '== Installing dependencies =='
|
|
18
|
+
system! 'gem install bundler --conservative'
|
|
19
|
+
system('bundle check') || system!('bundle install')
|
|
20
|
+
|
|
21
|
+
# Install JavaScript dependencies if using Yarn
|
|
22
|
+
# system('bin/yarn')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# puts "\n== Copying sample files =="
|
|
26
|
+
# unless File.exist?('config/database.yml')
|
|
27
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
|
28
|
+
# end
|
|
29
|
+
|
|
30
|
+
puts "\n== Preparing database =="
|
|
31
|
+
system! 'bin/rails db:setup'
|
|
32
|
+
|
|
33
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
34
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
35
|
+
|
|
36
|
+
puts "\n== Restarting application server =="
|
|
37
|
+
system! 'bin/rails restart'
|
|
38
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'pathname'
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
include FileUtils
|
|
5
|
+
|
|
6
|
+
# path to your application root.
|
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
|
8
|
+
|
|
9
|
+
def system!(*args)
|
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
chdir APP_ROOT do
|
|
14
|
+
# This script is a way to update your development environment automatically.
|
|
15
|
+
# Add necessary update steps to this file.
|
|
16
|
+
|
|
17
|
+
puts '== Installing dependencies =='
|
|
18
|
+
system! 'gem install bundler --conservative'
|
|
19
|
+
system('bundle check') || system!('bundle install')
|
|
20
|
+
|
|
21
|
+
puts "\n== Updating database =="
|
|
22
|
+
system! 'bin/rails db:migrate'
|
|
23
|
+
|
|
24
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
25
|
+
system! 'bin/rails log:clear tmp:clear'
|
|
26
|
+
|
|
27
|
+
puts "\n== Restarting application server =="
|
|
28
|
+
system! 'bin/rails restart'
|
|
29
|
+
end
|
data/test/dummy/bin/yarn
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
VENDOR_PATH = File.expand_path('..', __dir__)
|
|
3
|
+
Dir.chdir(VENDOR_PATH) do
|
|
4
|
+
begin
|
|
5
|
+
exec "yarnpkg #{ARGV.join(" ")}"
|
|
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,29 @@
|
|
|
1
|
+
require_relative 'boot'
|
|
2
|
+
|
|
3
|
+
require "action_controller/railtie"
|
|
4
|
+
require "action_view/railtie"
|
|
5
|
+
require "action_mailer/railtie"
|
|
6
|
+
require "rails/test_unit/railtie"
|
|
7
|
+
require "sprockets/railtie"
|
|
8
|
+
require 'teaspoon-mocha'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Workarea must be required before other gems to ensure control over Rails.env
|
|
12
|
+
# for running tests
|
|
13
|
+
require 'workarea/core'
|
|
14
|
+
require 'workarea/admin'
|
|
15
|
+
require 'workarea/storefront'
|
|
16
|
+
Bundler.require(*Rails.groups)
|
|
17
|
+
require "workarea/product_videos"
|
|
18
|
+
|
|
19
|
+
module Dummy
|
|
20
|
+
class Application < Rails::Application
|
|
21
|
+
# Initialize configuration defaults for originally generated Rails version.
|
|
22
|
+
config.load_defaults 5.1
|
|
23
|
+
|
|
24
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
25
|
+
# Application configuration should go into files in config/initializers
|
|
26
|
+
# -- all .rb files in that directory are automatically loaded.
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
|
17
|
+
config.action_controller.perform_caching = true
|
|
18
|
+
|
|
19
|
+
config.cache_store = :memory_store
|
|
20
|
+
config.public_file_server.headers = {
|
|
21
|
+
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
|
|
22
|
+
}
|
|
23
|
+
else
|
|
24
|
+
config.action_controller.perform_caching = false
|
|
25
|
+
|
|
26
|
+
config.cache_store = :null_store
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Don't care if the mailer can't send.
|
|
30
|
+
config.action_mailer.raise_delivery_errors = false
|
|
31
|
+
|
|
32
|
+
config.action_mailer.perform_caching = false
|
|
33
|
+
|
|
34
|
+
# Print deprecation notices to the Rails logger.
|
|
35
|
+
config.active_support.deprecation = :log
|
|
36
|
+
|
|
37
|
+
# Raise an error on page load if there are pending migrations.
|
|
38
|
+
# config.active_record.migration_error = :page_load
|
|
39
|
+
|
|
40
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
|
41
|
+
# This option may cause significant delays in view rendering with a large
|
|
42
|
+
# number of complex assets.
|
|
43
|
+
config.assets.debug = true
|
|
44
|
+
|
|
45
|
+
# Suppress logger output for asset requests.
|
|
46
|
+
config.assets.quiet = true
|
|
47
|
+
|
|
48
|
+
# Raises error for missing translations
|
|
49
|
+
# config.action_view.raise_on_missing_translations = true
|
|
50
|
+
|
|
51
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
52
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
|
53
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
54
|
+
end
|