Class: ReshapeHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/reshape_helper.rb

Class Method Summary collapse

Class Method Details

.schema_query(*dirs) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/reshape_helper.rb', line 7

def self.schema_query(*dirs)
	# Default to searching the migrations folder
	if dirs.empty?
		dirs = ["migrations"]
	end

	migrations = self.find_migrations(dirs)

	search_path = if migrations.empty?
		DEFAULT_SEARCH_PATH
	else
		"migration_#{migrations.last()}"
	end

	"SET search_path TO #{search_path}"
end