office_clerk 0.8 → 0.9

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.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -2
  3. data/Gemfile.lock +159 -100
  4. data/Guardfile +3 -0
  5. data/README.md +7 -2
  6. data/Rakefile +9 -0
  7. data/app/assets/images/missing_list.png +0 -0
  8. data/app/assets/images/missing_product.png +0 -0
  9. data/app/assets/images/missing_thumb.png +0 -0
  10. data/app/assets/javascripts/office_clerk.js +7 -5
  11. data/app/assets/stylesheets/office_clerk.css.scss +89 -14
  12. data/app/controllers/baskets_controller.rb +37 -26
  13. data/app/controllers/orders_controller.rb +44 -29
  14. data/app/controllers/products_controller.rb +6 -6
  15. data/app/controllers/purchases_controller.rb +18 -8
  16. data/app/helpers/admin_helper.rb +16 -21
  17. data/app/helpers/baskets_helper.rb +31 -0
  18. data/app/helpers/categories_helper.rb +3 -0
  19. data/app/helpers/office_helper.rb +34 -7
  20. data/app/helpers/orders_helper.rb +2 -3
  21. data/app/models/basket.rb +46 -20
  22. data/app/models/clerk.rb +6 -1
  23. data/app/models/item.rb +7 -0
  24. data/app/models/order.rb +18 -6
  25. data/app/models/product.rb +23 -8
  26. data/app/views/addresses/show.html.haml +2 -2
  27. data/app/views/baskets/_small.html.haml +2 -2
  28. data/app/views/baskets/edit.html.haml +19 -16
  29. data/app/views/baskets/index.html.haml +13 -5
  30. data/app/views/baskets/show.html.haml +3 -3
  31. data/app/views/categories/_treeview.html.haml +1 -2
  32. data/app/views/categories/edit.html.haml +4 -5
  33. data/app/views/categories/index.html.haml +7 -7
  34. data/app/views/categories/show.html.haml +3 -4
  35. data/app/views/clerks/edit.html.haml +4 -3
  36. data/app/views/clerks/index.html.haml +6 -6
  37. data/app/views/clerks/show.html.haml +3 -3
  38. data/app/views/layouts/_admin_menu.html.haml +8 -8
  39. data/app/views/layouts/_messages.html.haml +2 -2
  40. data/app/views/layouts/office_clerk.haml +10 -27
  41. data/app/views/order_mailer/confirm.text.erb +1 -2
  42. data/app/views/order_mailer/shipped.text.erb +2 -1
  43. data/app/views/orders/index.csv.erb +6 -6
  44. data/app/views/orders/index.html.haml +25 -20
  45. data/app/views/orders/shipment.haml +57 -0
  46. data/app/views/orders/show.html.haml +106 -39
  47. data/app/views/products/_head.haml +1 -2
  48. data/app/views/products/_line.html.haml +1 -1
  49. data/app/views/products/_preview_box.haml +14 -10
  50. data/app/views/products/_triple.html.haml +1 -1
  51. data/app/views/products/edit.html.haml +4 -4
  52. data/app/views/products/index.html.haml +24 -13
  53. data/app/views/products/show.html.haml +15 -12
  54. data/app/views/purchases/index.html.haml +11 -7
  55. data/app/views/purchases/show.html.haml +42 -25
  56. data/app/views/sessions/sign_up.haml +10 -10
  57. data/app/views/suppliers/edit.html.haml +2 -2
  58. data/app/views/suppliers/index.html.haml +6 -7
  59. data/app/views/suppliers/show.html.haml +2 -3
  60. data/config/i18n-tasks.yml +97 -0
  61. data/config/initializers/migrate.rb +11 -1
  62. data/config/initializers/paperclip.rb +17 -0
  63. data/config/locales/config.yml +0 -1
  64. data/config/locales/en.yml +99 -116
  65. data/config/locales/fi.yml +101 -117
  66. data/config/routes.rb +18 -15
  67. data/db/migrate/20131226143612_categories.rb +2 -2
  68. data/db/migrate/20131226151332_products.rb +3 -3
  69. data/lib/office_clerk/engine.rb +5 -8
  70. data/lib/office_clerk/shipping_method.rb +12 -1
  71. data/lib/office_clerk/version.rb +1 -1
  72. data/office_clerk.gemspec +5 -5
  73. data/spec/controllers/baskets_controller_spec.rb +2 -2
  74. data/spec/controllers/orders_controller_spec.rb +0 -29
  75. data/spec/controllers/products_controller_spec.rb +4 -3
  76. data/spec/controllers/purchases_controller_spec.rb +3 -4
  77. data/spec/factories/orders.rb +6 -1
  78. data/spec/factories/products.rb +3 -0
  79. data/spec/features/baskets/edit_spec.rb +6 -1
  80. data/spec/features/baskets/index_spec.rb +1 -0
  81. data/spec/features/baskets/search_spec.rb +1 -1
  82. data/spec/features/orders/filter_spec.rb +19 -0
  83. data/spec/features/orders/inventory_spec.rb +19 -0
  84. data/spec/features/orders/ordering_spec.rb +84 -0
  85. data/spec/features/paginate_spec.rb +11 -0
  86. data/spec/features/sessions_spec.rb +2 -1
  87. data/spec/{models/locale_spec.rb → i18n_spec.rb} +19 -1
  88. data/spec/mailers/order_mailer_spec.rb +2 -1
  89. data/spec/models/baskets/inventory_spec.rb +9 -2
  90. data/spec/models/baskets/items_spec.rb +6 -1
  91. data/spec/models/order_spec.rb +20 -1
  92. data/spec/routing/baskets_routing_spec.rb +5 -1
  93. data/spec/routing/orders_routing_spec.rb +0 -12
  94. data/spec/spec_helper.rb +16 -3
  95. data/test_app/bin/setup +29 -0
  96. data/test_app/config/application.rb +3 -0
  97. data/test_app/config/boot.rb +1 -2
  98. data/test_app/config/environment.rb +1 -1
  99. data/test_app/config/environments/development.rb +1 -1
  100. data/test_app/config/environments/production.rb +20 -21
  101. data/test_app/config/environments/test.rb +7 -4
  102. data/test_app/config/initializers/assets.rb +11 -0
  103. data/test_app/config/initializers/cookies_serializer.rb +3 -0
  104. data/test_app/config/initializers/mime_types.rb +0 -1
  105. data/test_app/config/initializers/session_store.rb +1 -1
  106. data/test_app/config/routes.rb +1 -2
  107. data/test_app/config/secrets.yml +22 -0
  108. data/test_app/db/migrate/20141114205526_suppliers.office.rb +1 -1
  109. data/test_app/db/migrate/20141114205527_categories.office.rb +3 -3
  110. data/test_app/db/migrate/20141114205528_items.office.rb +1 -1
  111. data/test_app/db/migrate/20141114205529_orders.office.rb +1 -1
  112. data/test_app/db/migrate/20141114205530_baskets.office.rb +1 -1
  113. data/test_app/db/migrate/20141114205531_purchases.office.rb +1 -1
  114. data/test_app/db/migrate/20141114205532_products.office.rb +4 -4
  115. data/test_app/db/schema.rb +26 -26
  116. metadata +35 -28
  117. data/app/views/orders/edit.html.haml +0 -25
  118. data/app/views/orders/ship.haml +0 -91
  119. data/app/views/purchases/edit.html.haml +0 -9
  120. data/spec/features/orders_spec.rb +0 -37
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Orders" do
4
+ before(:each) do
5
+ sign_in
6
+ end
7
+ it "deduct inventory when shipping" do
8
+ order = create(:order_paid)
9
+ visit_path order_path(order)
10
+ start = order.basket.items.first.product.inventory
11
+ find(".ship_now").click
12
+ expect(order.basket.reload.items.first.product.inventory).to equal start - order.basket.reload.items.first.quantity
13
+ end
14
+ it "not possible to ship twice" do
15
+ order = create(:order_shipped)
16
+ visit_path order_path(order)
17
+ expect {find(".ship_now").click}.to raise_error Capybara::ElementNotFound
18
+ end
19
+ end
@@ -0,0 +1,84 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Orders" do
4
+ before(:each) do
5
+ sign_in
6
+ end
7
+ it "should render" do
8
+ order = create :order
9
+ visit_path order_path order
10
+ end
11
+ it "creates order from basket" do
12
+ basket = create(:basket_with_item)
13
+ visit_path edit_basket_path(basket)
14
+ find(".make_order").click
15
+ ensure_path order_path(basket.reload.kori)
16
+ end
17
+ it "creates order from order" do
18
+ order = create(:order_ordered)
19
+ order.name = "Tester Man"
20
+ order.save
21
+ email = order.email
22
+ visit_path order_path(order)
23
+ find(".copy_order").click
24
+ copy = Order.find order.id + 1
25
+ ensure_path edit_basket_path(copy.basket)
26
+ expect(copy.email).to eq email
27
+ expect(order.name).to eq copy.name
28
+ end
29
+ it "ships an order" do
30
+ order = create(:order_ordered)
31
+ visit_path order_path(order)
32
+ find(".shipment_type").click
33
+ ensure_path shipment_order_path(order)
34
+ end
35
+ it "pays an order" do
36
+ order = create(:order_ordered)
37
+ visit_path order_path(order)
38
+ find(".pay_now").click
39
+ end
40
+ it "cant pay twice" do
41
+ order = create(:order_paid)
42
+ visit_path order_path(order)
43
+ expect {find(".pay_now").click}.to raise_error Capybara::ElementNotFound
44
+ end
45
+ it "can edit basket of ordered order" do
46
+ order = create(:order_ordered)
47
+ visit_path order_path(order)
48
+ find(".edit_basket").click
49
+ ensure_path edit_basket_path(order.basket)
50
+ end
51
+ it "can edit basket of paid order" do
52
+ order = create(:order_ordered)
53
+ visit_path order_path(order)
54
+ find(".edit_basket").click
55
+ ensure_path edit_basket_path(order.basket)
56
+ end
57
+ it "can cancel shipped order and edit" do
58
+ order = create(:order_shipped)
59
+ visit_path order_path(order)
60
+ find(".cancel_order").click
61
+ find(".edit_basket").click
62
+ ensure_path edit_basket_path(order.basket)
63
+ end
64
+ it "can not edit basket of shipped order" do
65
+ order = create(:order_paid)
66
+ visit_path order_path(order)
67
+ find(".ship_now").click
68
+ expect {find(".edit_basket").click}.to raise_error Capybara::ElementNotFound
69
+ end
70
+ it "allows shipment info to be changed" do
71
+ address = { :name => "Markus Janhunen" , :street => "123 my street", :city => "123 my town" , :phone => "0400404"}
72
+ order = create(:order_paid)
73
+ visit_path shipment_order_path(order)
74
+ address.each do |atrr, value|
75
+ fill_in("order_#{atrr}" , :with => value)
76
+ end
77
+ find("#make_order").click
78
+ ensure_path order_path(order)
79
+ order.reload
80
+ address.each do |atrr, value|
81
+ expect(order.send atrr).to eq value
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Pagination" do
4
+ before(:each) do
5
+ sign_in
6
+ end
7
+ it "lists 30 clerks" do
8
+ 30.times{ create(:clerk) }
9
+ visit_path clerks_path
10
+ end
11
+ end
@@ -1,12 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "Sessions" do
4
+
4
5
  it "redirect to sign in when accessing admin" do
5
6
  visit suppliers_path
6
7
  ensure_path sign_in_path
7
8
  end
8
9
  it "signs in with account" do
9
- user = create :clerk
10
+ user = create :clerk
10
11
  visit_path sign_in_path
11
12
  fill_in(:email , :with => user.email)
12
13
  fill_in(:password , :with => "password")
@@ -1,6 +1,8 @@
1
+ require 'spec_helper'
2
+ require 'i18n/tasks'
1
3
  require "i18n-spec"
2
4
 
3
- RSpec.describe 'locale:' do
5
+ describe 'locale:' do
4
6
 
5
7
  Dir.glob('config/locales/*.yml') do |locale_file|
6
8
  next if locale_file == "config/locales/config.yml"
@@ -19,3 +21,19 @@ RSpec.describe 'locale:' do
19
21
  it { is_expected.to be_a_complete_translation_of 'config/locales/fi.yml' }
20
22
  end
21
23
  end
24
+
25
+ describe 'I18n' do
26
+ let(:i18n) { I18n::Tasks::BaseTask.new }
27
+ let(:missing_keys) { i18n.missing_keys }
28
+ let(:unused_keys) { i18n.unused_keys }
29
+
30
+ it 'does not have missing keys' do
31
+ expect(missing_keys).to be_empty,
32
+ "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"
33
+ end
34
+
35
+ it 'does not have unused keys' do
36
+ expect(i18n.unused_keys).to be_empty,
37
+ "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them"
38
+ end
39
+ end
@@ -54,7 +54,8 @@ RSpec.describe OrderMailer, :type => :mailer do
54
54
 
55
55
  describe 'shipped mail' do
56
56
  let(:mail) do
57
- order.pay_now!
57
+ order.pay_now
58
+ order.save
58
59
  OrderMailer.shipped(order)
59
60
  end
60
61
  it_should_behave_like "an order mail" do
@@ -23,12 +23,19 @@ describe "Basket inventory" do
23
23
  basket = create :basket_2_items
24
24
  expect(basket.receive!).to be 3
25
25
  expect(basket.locked).not_to be nil
26
- expect { basket.receive! }.to raise_error
26
+ expect { basket.receive! }.to raise_error
27
27
  end
28
28
  it "locks after deduct" do
29
29
  basket = create :basket_2_items
30
30
  basket.deduct!
31
31
  expect(basket.locked).not_to be nil
32
- expect { basket.deduct! }.to raise_error
32
+ expect { basket.deduct! }.to raise_error
33
+ end
34
+ it "cancel order" do
35
+ basket = create :basket_2_items
36
+ basket.deduct!
37
+ basket.cancel_order!
38
+ expect(basket.locked).to be nil
39
+ expect(basket.deduct!).to be 3
33
40
  end
34
41
  end
@@ -2,9 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe "Basket totals" do
4
4
  let(:basket) { create :basket_2_items }
5
-
5
+
6
6
  it "creates proper quantities" do
7
7
  basket = create :basket_3_items
8
+ expect(basket.items.length).to eq 3
8
9
  end
9
10
  it "updates total on add" do
10
11
  items = basket.items
@@ -25,4 +26,8 @@ describe "Basket totals" do
25
26
  basket.save!
26
27
  expect(basket.items.length).to be 1
27
28
  end
29
+ it "zeros basket" do
30
+ basket.zero_prices!
31
+ expect(basket.total_price).to eq 0.0
32
+ end
28
33
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Order do
4
4
  let(:order) { create :order }
5
- let(:shipped_order) { create :order_shippped }
5
+ let(:shipped_order) { create :order_shipped }
6
6
 
7
7
  it "factory is ok" do
8
8
  o = build :order
@@ -10,6 +10,14 @@ describe Order do
10
10
  expect(ok).to be true
11
11
  end
12
12
 
13
+ it "doesnt save a blank order" do
14
+ expect(Order.new.save).to eq false
15
+ end
16
+
17
+ it "doesnt save order with just mail" do
18
+ expect(Order.new(:email => "torsten@villataika.fi").save).to eq false
19
+ end
20
+
13
21
  it "verification works" do
14
22
  o = Order.new attributes_for :order
15
23
  ok = o.save
@@ -18,6 +26,12 @@ describe Order do
18
26
 
19
27
  it "creates ok" do
20
28
  order
29
+ expect(order.basket.locked?).to eq false
30
+ end
31
+
32
+ it "creates shipped order" do
33
+ o = shipped_order
34
+ expect(o.basket.locked?).to eq true
21
35
  end
22
36
 
23
37
  it "calculates total tax" do
@@ -39,4 +53,9 @@ describe Order do
39
53
  it "calculates total tax with shipping" do
40
54
  expect(shipped_order.total_tax).to eq 2.5767
41
55
  end
56
+
57
+ it "cancels after shipping" do
58
+ expect(shipped_order.cancel!).to be true
59
+ end
60
+
42
61
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe BasketsController do
4
4
  routes { OfficeClerk::Engine.routes }
5
-
5
+
6
6
  describe "routing" do
7
7
 
8
8
  it "routes to #index" do
@@ -21,6 +21,10 @@ describe BasketsController do
21
21
  expect(get("/baskets/1/edit")).to route_to("baskets#edit", :id => "1")
22
22
  end
23
23
 
24
+ it "routes to #zero" do
25
+ expect(get("/baskets/1/zero")).to route_to("baskets#zero", :id => "1")
26
+ end
27
+
24
28
  it "routes to #create" do
25
29
  expect(post("/baskets")).to route_to("baskets#create")
26
30
  end
@@ -16,18 +16,6 @@ describe OrdersController do
16
16
  expect(get("/orders/1")).to route_to("orders#show", :id => "1")
17
17
  end
18
18
 
19
- it "routes to #edit" do
20
- expect(get("/orders/1/edit")).to route_to("orders#edit", :id => "1")
21
- end
22
-
23
- it "routes to #create" do
24
- expect(post("/orders")).to route_to("orders#create")
25
- end
26
-
27
- it "routes to #update" do
28
- expect(put("/orders/1")).to route_to("orders#update", :id => "1")
29
- end
30
-
31
19
  it "routes to #destroy" do
32
20
  expect(delete("/orders/1")).to route_to("orders#destroy", :id => "1")
33
21
  end
data/spec/spec_helper.rb CHANGED
@@ -13,13 +13,26 @@ require 'rspec/rails'
13
13
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
14
 
15
15
 
16
+ module OfficeClerk
17
+ module RSpec
18
+ module ControllerRoutes
19
+ extend ActiveSupport::Concern
20
+ included do
21
+ routes { ::OfficeClerk::Engine.routes }
22
+ end
23
+ end
24
+ end
25
+ end
26
+
16
27
  RSpec.configure do |config|
17
-
28
+
18
29
  config.include OfficeClerk::Engine.routes.url_helpers
19
30
 
31
+ config.include OfficeClerk::RSpec::ControllerRoutes, type: :controller
32
+
20
33
  config.infer_base_class_for_anonymous_controllers = false
21
34
  config.infer_spec_type_from_file_location!
22
-
35
+
23
36
  # Run specs in random order to surface order dependencies. If you find an
24
37
  # order dependency and want to debug it, you can fix the order by providing
25
38
  # the seed, which is printed after each run.
@@ -30,7 +43,7 @@ RSpec.configure do |config|
30
43
  config.default_formatter = 'doc'
31
44
  end
32
45
 
33
- # Print the 10 slowest examples and example groups at the end of the spec run,
46
+ # Print the 10 slowest examples and example groups at the end of the spec run,
34
47
  #to help surface which specs are running particularly slow.
35
48
  # config.profile_examples = 10
36
49
  end
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -24,5 +24,8 @@ module TestApp
24
24
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
25
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
26
  # config.i18n.default_locale = :de
27
+
28
+ # Do not swallow errors in after_commit/after_rollback callbacks.
29
+ config.active_record.raise_in_transactional_callbacks = true
27
30
  end
28
31
  end
@@ -1,4 +1,3 @@
1
- # Set up gems listed in the Gemfile.
2
1
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __FILE__)
3
2
 
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the Rails application.
5
- TestApp::Application.initialize!
5
+ Rails.application.initialize!
@@ -1,4 +1,4 @@
1
- TestApp::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,11 +1,11 @@
1
- TestApp::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
7
  # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both thread web servers
8
+ # your application in memory, allowing both threaded web servers
9
9
  # and those relying on copy on write to perform better.
10
10
  # Rake tasks automatically ignore this option for performance.
11
11
  config.eager_load = true
@@ -16,11 +16,13 @@ TestApp::Application.configure do
16
16
 
17
17
  # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
18
  # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
20
21
  # config.action_dispatch.rack_cache = true
21
22
 
22
- # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
24
26
 
25
27
  # Compress JavaScripts and CSS.
26
28
  config.assets.js_compressor = :uglifier
@@ -29,21 +31,22 @@ TestApp::Application.configure do
29
31
  # Do not fallback to assets pipeline if a precompiled asset is missed.
30
32
  config.assets.compile = false
31
33
 
32
- # Generate digests for assets URLs.
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
33
36
  config.assets.digest = true
34
37
 
35
- # Version of your assets, change this if you want to expire all your assets.
36
- config.assets.version = '1.0'
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
37
39
 
38
40
  # Specifies the header that your server uses for sending files.
39
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
41
43
 
42
44
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
45
  # config.force_ssl = true
44
46
 
45
- # Set to :debug to see everything in the log.
46
- config.log_level = :info
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
47
50
 
48
51
  # Prepend all log lines with the following tags.
49
52
  # config.log_tags = [ :subdomain, :uuid ]
@@ -55,26 +58,22 @@ TestApp::Application.configure do
55
58
  # config.cache_store = :mem_cache_store
56
59
 
57
60
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
- # config.action_controller.asset_host = "http://assets.example.com"
59
-
60
- # Precompile additional assets.
61
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
- # config.assets.precompile += %w( search.js )
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
63
62
 
64
63
  # Ignore bad email addresses and do not raise email delivery errors.
65
64
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
65
  # config.action_mailer.raise_delivery_errors = false
67
66
 
68
67
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
- # the I18n.default_locale when a translation can not be found).
68
+ # the I18n.default_locale when a translation cannot be found).
70
69
  config.i18n.fallbacks = true
71
70
 
72
71
  # Send deprecation notices to registered listeners.
73
72
  config.active_support.deprecation = :notify
74
73
 
75
- # Disable automatic flushing of the log to improve performance.
76
- # config.autoflush_log = false
77
-
78
74
  # Use default logging formatter so that PID and timestamp are not suppressed.
79
75
  config.log_formatter = ::Logger::Formatter.new
76
+
77
+ # Do not dump schema after migrations.
78
+ config.active_record.dump_schema_after_migration = false
80
79
  end