diff --git a/Gemfile b/Gemfile index 68a3e39..56c825a 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' gemspec group :test do - gem 'rails', '7.2.1' + gem 'rails', '8.0.0.rc2' gem 'rake', '~> 13.0' gem 'rubocop', '~> 1.0' gem 'rubocop-performance', '~> 1.5' diff --git a/angular_rails_csrf.gemspec b/angular_rails_csrf.gemspec index 4b9952d..64d2ccc 100644 --- a/angular_rails_csrf.gemspec +++ b/angular_rails_csrf.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 3.0' - s.add_dependency 'railties', '>= 3', '< 8' + s.add_dependency 'railties', '>= 3', '< 9' s.metadata = { 'rubygems_mfa_required' => 'true' diff --git a/lib/angular_rails_csrf/concern.rb b/lib/angular_rails_csrf/concern.rb index d78ced3..9a63fa5 100644 --- a/lib/angular_rails_csrf/concern.rb +++ b/lib/angular_rails_csrf/concern.rb @@ -42,6 +42,8 @@ def cookie_options_from(config) # Fetches the given option from config # If the option is not set, return a default value def option_from(config, option, default = nil) + return default if config.nil? + config.respond_to?(option) ? config.send(option) : default end diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index e8413b9..a81eca9 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -13,6 +13,6 @@ class Application < Rails::Application '437711d0ad314baf13efc0d35d7568d2e469668a7021cf5e945c667bd16507777aedb770f83' config.eager_load = false # You get yelled at if you don't set this config.active_support.test_order = :random - config.load_defaults 7.0 + config.load_defaults 8.0 end end