aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-04-30 12:42:12 +0200
committerJosé Valim <jose.valim@gmail.com>2010-04-30 12:42:12 +0200
commitcde168edbbe2d95dd8af40524dd9f42220481ef6 (patch)
tree6ef74c744eed96c69d6f7f0544cb998a37559ee4 /activerecord
parent7b98d2aa59e301c91d764262bba55133fef3538a (diff)
downloadrails-cde168edbbe2d95dd8af40524dd9f42220481ef6.tar.gz
rails-cde168edbbe2d95dd8af40524dd9f42220481ef6.tar.bz2
rails-cde168edbbe2d95dd8af40524dd9f42220481ef6.zip
Update generators to use thor 0.13.6 with simpler source_root handling.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/rails/generators/active_record.rb10
1 files changed, 3 insertions, 7 deletions
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