From cde168edbbe2d95dd8af40524dd9f42220481ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 30 Apr 2010 12:42:12 +0200 Subject: Update generators to use thor 0.13.6 with simpler source_root handling. --- activerecord/lib/rails/generators/active_record.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'activerecord/lib/rails/generators/active_record.rb') diff --git a/activerecord/lib/rails/generators/active_record.rb b/activerecord/lib/rails/generators/active_record.rb index d2b1e86857..5d8a8e81bc 100644 --- a/activerecord/lib/rails/generators/active_record.rb +++ b/activerecord/lib/rails/generators/active_record.rb @@ -8,16 +8,12 @@ module ActiveRecord class Base < Rails::Generators::NamedBase #:nodoc: include Rails::Generators::Migration - def self.source_root - @_ar_source_root ||= begin - if base_name && generator_name - File.expand_path(File.join(base_name, generator_name, 'templates'), File.dirname(__FILE__)) - end - end + # Set the current directory as base for the inherited generators. + def self.base_root + File.dirname(__FILE__) end # Implement the required interface for Rails::Generators::Migration. - # def self.next_migration_number(dirname) #:nodoc: next_migration_number = current_migration_number(dirname) + 1 if ActiveRecord::Base.timestamped_migrations -- cgit v1.2.3