Skip to content

Commit 08a5a70

Browse files
committed
Build for Rails 5.1
Not all of our dependencies are Rails 5.2 compatible yet. That's why we need to stick with Rails 5.1 for now.
1 parent a4959b3 commit 08a5a70

4 files changed

Lines changed: 30 additions & 10 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ source "https://rubygems.org"
22

33
gemspec
44

5+
gem 'rails', '~> 5.1.6'
56
gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: 'master'
67
gem 'sassc-rails'
78

spec/dummy/config/application.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
# require "action_cable/engine"
1111
# require "rails/test_unit/railtie"
1212

13+
# Require the gems listed in Gemfile, including any gems
14+
# you've limited to :test, :development, or :production.
1315
Bundler.require(*Rails.groups)
1416
require "alchemy/devise"
1517

1618
module Dummy
1719
class Application < Rails::Application
20+
# Initialize configuration defaults for originally generated Rails version.
21+
config.load_defaults 5.1
22+
1823
# Settings in config/environments/* take precedence over those specified here.
1924
# Application configuration should go into files in config/initializers
2025
# -- all .rb files in that directory are automatically loaded.

spec/dummy/config/initializers/new_framework_defaults.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
#
33
# This file contains migration options to ease your Rails 5.0 upgrade.
44
#
5-
# Once upgraded flip defaults one by one to migrate to the new default.
6-
#
75
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
86

9-
Rails.application.config.raise_on_unfiltered_parameters = true
10-
117
# Enable per-form CSRF tokens. Previous versions had false.
12-
Rails.application.config.action_controller.per_form_csrf_tokens = false
8+
Rails.application.config.action_controller.per_form_csrf_tokens = true
139

1410
# Enable origin-checking CSRF mitigation. Previous versions had false.
15-
Rails.application.config.action_controller.forgery_protection_origin_check = false
11+
Rails.application.config.action_controller.forgery_protection_origin_check = true
12+
Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
1613

1714
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
1815
# Previous versions had false.
19-
ActiveSupport.to_time_preserves_timezone = false
16+
ActiveSupport.to_time_preserves_timezone = true
2017

2118
# Require `belongs_to` associations by default. Previous versions had false.
22-
Rails.application.config.active_record.belongs_to_required_by_default = false
19+
Rails.application.config.active_record.belongs_to_required_by_default = true
20+
21+
# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
22+
Rails.application.config.ssl_options = { hsts: { subdomains: true } }
2323

24-
# Do not halt callback chains when a callback returns false. Previous versions had true.
25-
ActiveSupport.halt_callback_chains_on_return_false = true
24+
# The Event model of the dummy app has a time column. Time columns will become time zone aware in Rails 5.1
25+
ActiveRecord::Base.time_zone_aware_types = [:datetime, :time]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Be sure to restart your server when you modify this file.
2+
#
3+
# This file contains migration options to ease your Rails 5.1 upgrade.
4+
#
5+
# Once upgraded flip defaults one by one to migrate to the new default.
6+
#
7+
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
8+
9+
# Make `form_with` generate non-remote forms.
10+
Rails.application.config.action_view.form_with_generates_remote_forms = false
11+
12+
# Unknown asset fallback will return the path passed in when the given
13+
# asset is not present in the asset pipeline.
14+
# Rails.application.config.assets.unknown_asset_fallback = false

0 commit comments

Comments
 (0)