Skip to content

Commit 463c6d1

Browse files
author
Arne De Herdt
committed
[Ruby on Rails] Wrap the SQLite configuration for supported versions
1 parent 75799f1 commit 463c6d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/dummy/config/initializers/sqlite3.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55

66
# Enforce booleans to represented as integers in the database.
77
# This was an old SQLite feature that we do not want to support anymore.
8-
::Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
8+
# Note: This is only for older versions of Sqlite3, the configuration option was dropped at some point
9+
if ::Rails.application.config.active_record.sqlite3.respond_to?(:represent_boolean_as_integer)
10+
::Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
11+
end

0 commit comments

Comments
 (0)