diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-07-03 02:38:12 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-07-03 02:45:54 +0900 |
commit | 324f6fa20779433578f8c0cbaf4ff9343817dd4b (patch) | |
tree | 2e11ecce100ea5a787da9cd53992ec0c36a5a8d4 /activerecord/lib/active_record/connection_adapters | |
parent | 02aac286a6bd8db0eeb606d639c7a7e78ac01453 (diff) | |
parent | bf1024de5500f3c8d2c3b1876894feb02ba26ea7 (diff) | |
download | rails-324f6fa20779433578f8c0cbaf4ff9343817dd4b.tar.gz rails-324f6fa20779433578f8c0cbaf4ff9343817dd4b.tar.bz2 rails-324f6fa20779433578f8c0cbaf4ff9343817dd4b.zip |
Merge pull request #33242 from brasic/sqlite-readonly
Support readonly option in SQLite3Adapter
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index 544374586c..844af952c1 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -15,6 +15,8 @@ require "sqlite3" module ActiveRecord module ConnectionHandling # :nodoc: def sqlite3_connection(config) + config = config.symbolize_keys + # Require database. unless config[:database] raise ArgumentError, "No database file specified. Missing argument: database" @@ -31,7 +33,7 @@ module ActiveRecord db = SQLite3::Database.new( config[:database].to_s, - results_as_hash: true + config.merge(results_as_hash: true) ) db.busy_timeout(ConnectionAdapters::SQLite3Adapter.type_cast_config_to_integer(config[:timeout])) if config[:timeout] |