Method: ActiveTenant::SQLiteAdapter#with
- Defined in:
- lib/active_tenant/adapters/sqlite_adapter.rb
#with(name) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/active_tenant/adapters/sqlite_adapter.rb', line 28 def with(name) return yield if name == self.name current_config = connection_config ex = nil begin establish_connection connection_settings(name) result = yield rescue => e ex = e ensure establish_connection current_config raise ex unless ex.nil? result end end |