Code Climate Build Status Coverage Status Dependency Status

ActiveConnection

ActiveConnection is a simple wrapper around ActiveRecord::Base.connection.schema_search_path.

Installation

Add this line to your application's Gemfile:

gem 'active_connection'

And then execute:

$ bundle

Usage

Useful in multi-tenant situations where you have a user table in the public schema and a separate schema for each tenants data.

ActiveConnection.schema_search_path('other_schema', 'public') do
  # Do something that depends on other_schema
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request