Class: BranchDb::PostgresqlSwitcher
- Includes:
- RealDbSwitchersCommon
- Defined in:
- lib/branch_db/postgresql_switcher.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from RealDbSwitchersCommon
Methods inherited from Switcher
branches, #copy_from, create, #create_empty_database, #delete_database, #exists?, #initialize, #switch!, which
Constructor Details
This class inherits a constructor from BranchDb::Switcher
Class Method Details
.can_handle?(config) ⇒ Boolean
10 11 12 |
# File 'lib/branch_db/postgresql_switcher.rb', line 10 def self.can_handle?(config) config['adapter'] == 'postgresql' end |
Instance Method Details
#current ⇒ Object
14 15 16 17 |
# File 'lib/branch_db/postgresql_switcher.rb', line 14 def current current_branch = branch_db_exists?(@branch) ? @branch : 'master' puts "#{@rails_env}: #{branch_db(current_branch)} (PostgreSQL)" end |