mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rake tasks should load generators from new paths.
This commit is contained in:
parent
68b76a38eb
commit
728db5a932
2 changed files with 3 additions and 3 deletions
|
@ -428,7 +428,7 @@ namespace :db do
|
||||||
task :create => :environment do
|
task :create => :environment do
|
||||||
raise "Task unavailable to this database (no migration support)" unless ActiveRecord::Base.connection.supports_migrations?
|
raise "Task unavailable to this database (no migration support)" unless ActiveRecord::Base.connection.supports_migrations?
|
||||||
require 'rails/generators'
|
require 'rails/generators'
|
||||||
require 'rails/generators/rails/session_migration/session_migration_generator'
|
require 'generators/rails/session_migration/session_migration_generator'
|
||||||
Rails::Generators::SessionMigrationGenerator.start [ ENV["MIGRATION"] || "add_sessions_table" ]
|
Rails::Generators::SessionMigrationGenerator.start [ ENV["MIGRATION"] || "add_sessions_table" ]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace :rails do
|
||||||
template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
|
template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
|
||||||
|
|
||||||
require 'rails/generators'
|
require 'rails/generators'
|
||||||
require 'rails/generators/rails/app/app_generator'
|
require 'generators/rails/app/app_generator'
|
||||||
generator = Rails::Generators::AppGenerator.new [ Rails.root ], {}, :destination_root => Rails.root
|
generator = Rails::Generators::AppGenerator.new [ Rails.root ], {}, :destination_root => Rails.root
|
||||||
generator.apply template, :verbose => false
|
generator.apply template, :verbose => false
|
||||||
end
|
end
|
||||||
|
@ -94,7 +94,7 @@ namespace :rails do
|
||||||
namespace :update do
|
namespace :update do
|
||||||
def invoke_from_app_generator(method)
|
def invoke_from_app_generator(method)
|
||||||
require 'rails/generators'
|
require 'rails/generators'
|
||||||
require 'rails/generators/rails/app/app_generator'
|
require 'generators/rails/app/app_generator'
|
||||||
|
|
||||||
generator = Rails::Generators::AppGenerator.new ["rails"], { :with_dispatchers => true },
|
generator = Rails::Generators::AppGenerator.new ["rails"], { :with_dispatchers => true },
|
||||||
:destination_root => Rails.root
|
:destination_root => Rails.root
|
||||||
|
|
Loading…
Reference in a new issue