From 463c6d1d62eca04469e5e729afa85fffb087b491 Mon Sep 17 00:00:00 2001 From: Arne De Herdt Date: Fri, 16 Sep 2022 09:39:35 +0200 Subject: [PATCH] [Ruby on Rails] Wrap the SQLite configuration for supported versions --- test/dummy/config/initializers/sqlite3.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/dummy/config/initializers/sqlite3.rb b/test/dummy/config/initializers/sqlite3.rb index 2d460c9..b80ef28 100644 --- a/test/dummy/config/initializers/sqlite3.rb +++ b/test/dummy/config/initializers/sqlite3.rb @@ -5,4 +5,7 @@ # Enforce booleans to represented as integers in the database. # This was an old SQLite feature that we do not want to support anymore. -::Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true \ No newline at end of file +# Note: This is only for older versions of Sqlite3, the configuration option was dropped at some point +if ::Rails.application.config.active_record.sqlite3.respond_to?(:represent_boolean_as_integer) + ::Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true +end