lib/chatterbot/db.rb in chatterbot-0.2.9 vs lib/chatterbot/db.rb in chatterbot-0.3.0

- old
+ new

@@ -9,15 +9,21 @@ # connect to the database, and generate any missing tables def db @_db ||= connect_and_validate end + def display_db_config_notice + puts "ERROR: You have specified a DB connection, but you need to install the sequel gem to use it" + end + protected # # get a DB object from Sequel def get_connection - if has_sequel? + if ! has_sequel? && config.has_key?(:db_uri) + display_db_config_notice + elsif has_sequel? Sequel.connect(config[:db_uri]) end end #