Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure db/migrate exists when creating migration

  • Loading branch information...
commit c2d6f2c2269d7f07f4fe8ab0fff8896f477e67b3 1 parent bdd05bc
@nertzy nertzy authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/pg_search/tasks.rb
View
5 lib/pg_search/tasks.rb
@@ -1,4 +1,5 @@
require 'rake'
+require 'fileutils'
require 'pg_search'
namespace :pg_search do
@@ -17,7 +18,9 @@
now = Time.now.utc
filename = "#{now.strftime('%Y%m%d%H%M%S')}_create_pg_search_documents.rb"
- File.open(Rails.root + 'db' + 'migrate' + filename, 'wb') do |migration_file|
+ FileUtils.mkdir_p(Rails.root.join('db', 'migrate'))
+
+ File.open(Rails.root.join('db', 'migrate', filename), 'wb') do |migration_file|
migration_file.puts <<-RUBY
class CreatePgSearchDocuments < ActiveRecord::Migration
def self.up
Please sign in to comment.
Something went wrong with that request. Please try again.