Skip to content

Commit

Permalink
Use default env
Browse files Browse the repository at this point in the history
  • Loading branch information
gussan committed May 21, 2014
1 parent 694cc8f commit 31b5ec3
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -5,7 +5,7 @@ module Tasks
module DatabaseTasks
attr_accessor :exclude_shard_regexp

def create_current_cluster(environment)
def create_current_cluster(environment = env)
each_current_cluster_configuration(environment) { |configuration|
puts "*** executing to database: #{configuration['database']}"
create configuration
Expand All @@ -20,7 +20,7 @@ def drop_current_cluster(environment = env)
}
end

def each_current_cluster_connected(environment, exclude_pattern = exclude_shard_regexp)
def each_current_cluster_connected(environment = env, exclude_pattern = exclude_shard_regexp)
each_current_cluster_configuration(environment, exclude_pattern) do |configuration|
ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.establish_connection(configuration)
Expand All @@ -33,7 +33,7 @@ def each_current_cluster_connected(environment, exclude_pattern = exclude_shard_
private

# TODO: same spec checking
def each_current_cluster_configuration(environment, exclude_pattern = nil)
def each_current_cluster_configuration(environment = env, exclude_pattern = nil)
environments = [environment]
environments << 'test' if environment == 'development'
regexp = Regexp.compile("(#{environments.map {|e| Regexp.escape(e)}.join('|')})")
Expand Down

0 comments on commit 31b5ec3

Please sign in to comment.