metaslug 0.3.3

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 (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/Gemfile +6 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.md +112 -0
  6. data/Rakefile +19 -0
  7. data/lib/metaslug/controllers/action_controller_extension.rb +165 -0
  8. data/lib/metaslug/helpers/action_view_extension.rb +49 -0
  9. data/lib/metaslug/hooks.rb +15 -0
  10. data/lib/metaslug/railtie.rb +7 -0
  11. data/lib/metaslug/version.rb +3 -0
  12. data/lib/metaslug.rb +7 -0
  13. data/lib/rails/generators/metaslug/install/install_generator.rb +21 -0
  14. data/lib/rails/generators/metaslug/locale/locale_generator.rb +69 -0
  15. data/lib/tasks/metaslug_tasks.rake +4 -0
  16. data/metaslug.gemspec +24 -0
  17. data/test/dummy/Rakefile +6 -0
  18. data/test/dummy/app/assets/images/.keep +0 -0
  19. data/test/dummy/app/assets/javascripts/application.js +13 -0
  20. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  21. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  22. data/test/dummy/app/controllers/application_controller.rb +13 -0
  23. data/test/dummy/app/controllers/categories_controller.rb +58 -0
  24. data/test/dummy/app/controllers/concerns/.keep +0 -0
  25. data/test/dummy/app/controllers/pages_controller.rb +12 -0
  26. data/test/dummy/app/controllers/posts_controller.rb +60 -0
  27. data/test/dummy/app/helpers/application_helper.rb +2 -0
  28. data/test/dummy/app/helpers/categories_helper.rb +2 -0
  29. data/test/dummy/app/helpers/metaslug_helper.rb +2 -0
  30. data/test/dummy/app/helpers/pages_helper.rb +2 -0
  31. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  32. data/test/dummy/app/mailers/.keep +0 -0
  33. data/test/dummy/app/models/.keep +0 -0
  34. data/test/dummy/app/models/category.rb +3 -0
  35. data/test/dummy/app/models/concerns/.keep +0 -0
  36. data/test/dummy/app/models/page.rb +3 -0
  37. data/test/dummy/app/models/post.rb +5 -0
  38. data/test/dummy/app/views/categories/_form.html.erb +21 -0
  39. data/test/dummy/app/views/categories/edit.html.erb +6 -0
  40. data/test/dummy/app/views/categories/index.html.erb +25 -0
  41. data/test/dummy/app/views/categories/new.html.erb +5 -0
  42. data/test/dummy/app/views/categories/show.html.erb +9 -0
  43. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  44. data/test/dummy/app/views/pages/show.html.erb +1 -0
  45. data/test/dummy/app/views/posts/_form.html.erb +33 -0
  46. data/test/dummy/app/views/posts/edit.html.erb +6 -0
  47. data/test/dummy/app/views/posts/index.html.erb +31 -0
  48. data/test/dummy/app/views/posts/new.html.erb +5 -0
  49. data/test/dummy/app/views/posts/show.html.erb +24 -0
  50. data/test/dummy/bin/bundle +3 -0
  51. data/test/dummy/bin/rails +4 -0
  52. data/test/dummy/bin/rake +4 -0
  53. data/test/dummy/config/application.rb +23 -0
  54. data/test/dummy/config/boot.rb +5 -0
  55. data/test/dummy/config/database.example.yml +22 -0
  56. data/test/dummy/config/environment.rb +5 -0
  57. data/test/dummy/config/environments/development.rb +37 -0
  58. data/test/dummy/config/environments/production.rb +82 -0
  59. data/test/dummy/config/environments/test.rb +39 -0
  60. data/test/dummy/config/initializers/assets.rb +8 -0
  61. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  62. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  63. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  64. data/test/dummy/config/initializers/inflections.rb +16 -0
  65. data/test/dummy/config/initializers/initializer.rb +1 -0
  66. data/test/dummy/config/initializers/metaslug.rb +1 -0
  67. data/test/dummy/config/initializers/mime_types.rb +4 -0
  68. data/test/dummy/config/initializers/session_store.rb +3 -0
  69. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  70. data/test/dummy/config/locales/de.yml +2 -0
  71. data/test/dummy/config/locales/en.yml +23 -0
  72. data/test/dummy/config/locales/fr.yml +23 -0
  73. data/test/dummy/config/metaslug/de.yml +4 -0
  74. data/test/dummy/config/metaslug/en.yml +61 -0
  75. data/test/dummy/config/metaslug/fr.yml +41 -0
  76. data/test/dummy/config/routes.rb +12 -0
  77. data/test/dummy/config.ru +4 -0
  78. data/test/dummy/db/migrate/20140924091048_create_posts.rb +12 -0
  79. data/test/dummy/db/migrate/20140924091105_create_categories.rb +9 -0
  80. data/test/dummy/db/migrate/20140925101545_create_pages.rb +11 -0
  81. data/test/dummy/db/migrate/20140929145421_add_title_and_description_to_page.rb +6 -0
  82. data/test/dummy/db/schema.rb +43 -0
  83. data/test/dummy/lib/assets/.keep +0 -0
  84. data/test/dummy/log/.keep +0 -0
  85. data/test/dummy/public/404.html +67 -0
  86. data/test/dummy/public/422.html +67 -0
  87. data/test/dummy/public/500.html +66 -0
  88. data/test/dummy/public/favicon.ico +0 -0
  89. data/test/dummy/test/fixtures/categories.yml +7 -0
  90. data/test/dummy/test/fixtures/pages.yml +23 -0
  91. data/test/dummy/test/fixtures/posts.yml +13 -0
  92. data/test/dummy/test/helpers/metaslug_helper_test.rb +25 -0
  93. data/test/dummy/test/integration/metas_test.rb +91 -0
  94. data/test/metaslug_test.rb +5 -0
  95. data/test/test_helper.rb +30 -0
  96. metadata +274 -0
@@ -0,0 +1,58 @@
1
+ class CategoriesController < ApplicationController
2
+ before_action :set_category, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /categories
5
+ def index
6
+ @categories = Category.all
7
+ end
8
+
9
+ # GET /categories/1
10
+ def show
11
+ end
12
+
13
+ # GET /categories/new
14
+ def new
15
+ @category = Category.new
16
+ end
17
+
18
+ # GET /categories/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /categories
23
+ def create
24
+ @category = Category.new(category_params)
25
+
26
+ if @category.save
27
+ redirect_to @category, notice: 'Category was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /categories/1
34
+ def update
35
+ if @category.update(category_params)
36
+ redirect_to @category, notice: 'Category was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /categories/1
43
+ def destroy
44
+ @category.destroy
45
+ redirect_to categories_url, notice: 'Category was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_category
51
+ @category = Category.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def category_params
56
+ params.require(:category).permit(:title)
57
+ end
58
+ end
File without changes
@@ -0,0 +1,12 @@
1
+ class PagesController < ApplicationController
2
+ metaslug_vars :page
3
+
4
+ def show
5
+ @page = Page.find_by(slug: params[:slug])
6
+ if @page
7
+ render :show, locals: { page: @page }
8
+ else
9
+ render nothing: true, status: 404
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,60 @@
1
+ class PostsController < ApplicationController
2
+ before_action :set_post, only: [:show, :edit, :update, :destroy]
3
+ metaslug_vars :post, only: :show
4
+ metaslug_vars :post, only: :edit
5
+
6
+ # GET /posts
7
+ def index
8
+ @posts = Post.all
9
+ end
10
+
11
+ # GET /posts/1
12
+ def show
13
+ end
14
+
15
+ # GET /posts/new
16
+ def new
17
+ @post = Post.new
18
+ end
19
+
20
+ # GET /posts/1/edit
21
+ def edit
22
+ end
23
+
24
+ # POST /posts
25
+ def create
26
+ @post = Post.new(post_params)
27
+
28
+ if @post.save
29
+ redirect_to @post, notice: 'Post was successfully created.'
30
+ else
31
+ render :new
32
+ end
33
+ end
34
+
35
+ # PATCH/PUT /posts/1
36
+ def update
37
+ if @post.update(post_params)
38
+ redirect_to @post, notice: 'Post was successfully updated.'
39
+ else
40
+ render :edit
41
+ end
42
+ end
43
+
44
+ # DELETE /posts/1
45
+ def destroy
46
+ @post.destroy
47
+ redirect_to posts_url, notice: 'Post was successfully destroyed.'
48
+ end
49
+
50
+ private
51
+ # Use callbacks to share common setup or constraints between actions.
52
+ def set_post
53
+ @post = Post.find(params[:id])
54
+ end
55
+
56
+ # Only allow a trusted parameter "white list" through.
57
+ def post_params
58
+ params.require(:post).permit(:content, :title, :active, :category_id)
59
+ end
60
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module CategoriesHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module MetaslugHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module PagesHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module PostsHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ class Category < ActiveRecord::Base
2
+ has_many :posts
3
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ class Page < ActiveRecord::Base
2
+ liquid_methods :title, :description
3
+ end
@@ -0,0 +1,5 @@
1
+ class Post < ActiveRecord::Base
2
+ liquid_methods :title
3
+
4
+ belongs_to :category
5
+ end
@@ -0,0 +1,21 @@
1
+ <%= form_for(@category) do |f| %>
2
+ <% if @category.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@category.errors.count, "error") %> prohibited this category from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @category.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :title %><br>
16
+ <%= f.text_field :title %>
17
+ </div>
18
+ <div class="actions">
19
+ <%= f.submit %>
20
+ </div>
21
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing category</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @category %> |
6
+ <%= link_to 'Back', categories_path %>
@@ -0,0 +1,25 @@
1
+ <h1>Listing categories</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Title</th>
7
+ <th colspan="3"></th>
8
+ </tr>
9
+ </thead>
10
+
11
+ <tbody>
12
+ <% @categories.each do |category| %>
13
+ <tr>
14
+ <td><%= category.title %></td>
15
+ <td><%= link_to 'Show', category %></td>
16
+ <td><%= link_to 'Edit', edit_category_path(category) %></td>
17
+ <td><%= link_to 'Destroy', category, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
+ </tr>
19
+ <% end %>
20
+ </tbody>
21
+ </table>
22
+
23
+ <br>
24
+
25
+ <%= link_to 'New Category', new_category_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New category</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', categories_path %>
@@ -0,0 +1,9 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Title:</strong>
5
+ <%= @category.title %>
6
+ </p>
7
+
8
+ <%= link_to 'Edit', edit_category_path(@category) %> |
9
+ <%= link_to 'Back', categories_path %>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <%= metaslug %>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1 @@
1
+ <%= page.content.html_safe %>
@@ -0,0 +1,33 @@
1
+ <%= form_for(@post) do |f| %>
2
+ <% if @post.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @post.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :content %><br>
16
+ <%= f.text_area :content %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :title %><br>
20
+ <%= f.text_field :title %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :active %><br>
24
+ <%= f.check_box :active %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :category_id %><br>
28
+ <%= f.text_field :category_id %>
29
+ </div>
30
+ <div class="actions">
31
+ <%= f.submit %>
32
+ </div>
33
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing post</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @post %> |
6
+ <%= link_to 'Back', posts_path %>
@@ -0,0 +1,31 @@
1
+ <h1>Listing posts</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Content</th>
7
+ <th>Title</th>
8
+ <th>Active</th>
9
+ <th>Category</th>
10
+ <th colspan="3"></th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @posts.each do |post| %>
16
+ <tr>
17
+ <td><%= post.content %></td>
18
+ <td><%= post.title %></td>
19
+ <td><%= post.active %></td>
20
+ <td><%= post.category %></td>
21
+ <td><%= link_to 'Show', post %></td>
22
+ <td><%= link_to 'Edit', edit_post_path(post) %></td>
23
+ <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
24
+ </tr>
25
+ <% end %>
26
+ </tbody>
27
+ </table>
28
+
29
+ <br>
30
+
31
+ <%= link_to 'New Post', new_post_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New post</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', posts_path %>
@@ -0,0 +1,24 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Content:</strong>
5
+ <%= @post.content %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Title:</strong>
10
+ <%= @post.title %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Active:</strong>
15
+ <%= @post.active %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Category:</strong>
20
+ <%= @post.category %>
21
+ </p>
22
+
23
+ <%= link_to 'Edit', edit_post_path(@post) %> |
24
+ <%= link_to 'Back', posts_path %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "metaslug"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+ end
22
+ end
23
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,22 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
+ development:
4
+ adapter: sqlite3
5
+ database: db/development.sqlite3
6
+ pool: 5
7
+ timeout: 5000
8
+
9
+ # Warning: The database defined as "test" will be erased and
10
+ # re-generated from your development database when you run "rake".
11
+ # Do not set this db to the same as development or production.
12
+ test:
13
+ adapter: sqlite3
14
+ database: db/test.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ production:
19
+ adapter: sqlite3
20
+ database: db/production.sqlite3
21
+ pool: 5
22
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,37 @@
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 and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations.
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+
30
+ # Adds additional error checking when serving assets at runtime.
31
+ # Checks for improperly declared sprockets dependencies.
32
+ # Raises helpful error messages.
33
+ config.assets.raise_runtime_errors = true
34
+
35
+ # Raises error for missing translations
36
+ # config.action_view.raise_on_missing_translations = true
37
+ end
@@ -0,0 +1,82 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
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.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Generate digests for assets URLs.
33
+ config.assets.digest = true
34
+
35
+ # `config.assets.precompile` has moved to config/initializers/assets.rb
36
+
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
40
+
41
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
42
+ # config.force_ssl = true
43
+
44
+ # Set to :debug to see everything in the log.
45
+ config.log_level = :info
46
+
47
+ # Prepend all log lines with the following tags.
48
+ # config.log_tags = [ :subdomain, :uuid ]
49
+
50
+ # Use a different logger for distributed setups.
51
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
52
+
53
+ # Use a different cache store in production.
54
+ # config.cache_store = :mem_cache_store
55
+
56
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
57
+ # config.action_controller.asset_host = "http://assets.example.com"
58
+
59
+ # Precompile additional assets.
60
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
61
+ # config.assets.precompile += %w( search.js )
62
+
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65
+ # config.action_mailer.raise_delivery_errors = false
66
+
67
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # the I18n.default_locale when a translation cannot be found).
69
+ config.i18n.fallbacks = true
70
+
71
+ # Send deprecation notices to registered listeners.
72
+ config.active_support.deprecation = :notify
73
+
74
+ # Disable automatic flushing of the log to improve performance.
75
+ # config.autoflush_log = false
76
+
77
+ # Use default logging formatter so that PID and timestamp are not suppressed.
78
+ config.log_formatter = ::Logger::Formatter.new
79
+
80
+ # Do not dump schema after migrations.
81
+ config.active_record.dump_schema_after_migration = false
82
+ end
@@ -0,0 +1,39 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+
37
+ # Raises error for missing translations
38
+ # config.action_view.raise_on_missing_translations = true
39
+ end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Precompile additional assets.
7
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]