Module: ActiveRecord::ConnectionHandling
- Defined in:
- lib/active_record/connection_adapters/cubrid2_adapter.rb
Overview
:nodoc:
Constant Summary collapse
- ER_DATABASE_CONNECTION_ERROR =
-1000
Instance Method Summary collapse
-
#cubrid2_connection(config) ⇒ Object
Establishes a connection to the database that’s used by all Active Record objects.
Instance Method Details
#cubrid2_connection(config) ⇒ Object
Establishes a connection to the database that’s used by all Active Record objects.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/active_record/connection_adapters/cubrid2_adapter.rb', line 12 def cubrid2_connection(config) config = config.symbolize_keys config[:flags] ||= 0 client = ::Cubrid2::Client.new(config) ConnectionAdapters::Cubrid2Adapter.new(client, logger, nil, config) rescue Cubrid2::Error => e raise ActiveRecord::NoDatabaseError if e.error_number == ER_DATABASE_CONNECTION_ERROR raise end |