lib/ditty/db.rb in ditty-0.7.2 vs lib/ditty/db.rb in ditty-0.8.0
- old
+ new
@@ -16,11 +16,13 @@
ENV['RACK_ENV'] == 'production' ? ENV.delete('DATABASE_URL') : ENV['DATABASE_URL'],
pool_timeout: pool_timeout
)
DB.sql_log_level = (ENV['SEQUEL_LOGGING_LEVEL'] || :debug).to_sym
- DB.loggers << Ditty::Services::Logger.instance
+ DB.loggers << Ditty::Services::Logger.instance if ENV['DB_DEBUG'].to_i == 1
DB.extension(:pagination)
+ DB.extension(:schema_caching)
+ DB.load_schema_cache?('./config/schema.dump')
Sequel::Model.plugin :validation_helpers
Sequel::Model.plugin :update_or_create
Sequel::Model.plugin :timestamps, update_on_create: true
else