aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-07-12 06:23:50 +0000
committerRick Olson <technoweenie@gmail.com>2007-07-12 06:23:50 +0000
commitf9b7394430f50c110b0f07d7e3c06d5b3d9b0f44 (patch)
treee4521a3e586002aec7c4a3aa73105d11b6725c7c /railties/lib/rails_generator
parent816522ecd8615bf96e8b932ac358fe9346b286ee (diff)
downloadrails-f9b7394430f50c110b0f07d7e3c06d5b3d9b0f44.tar.gz
rails-f9b7394430f50c110b0f07d7e3c06d5b3d9b0f44.tar.bz2
rails-f9b7394430f50c110b0f07d7e3c06d5b3d9b0f44.zip
Default to plural table name in Rails Generator if ActiveRecord is not present. Closes #8963 [evan]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7183 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r--railties/lib/rails_generator/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/base.rb b/railties/lib/rails_generator/base.rb
index 1c3d2936a4..95d716fb90 100644
--- a/railties/lib/rails_generator/base.rb
+++ b/railties/lib/rails_generator/base.rb
@@ -228,7 +228,7 @@ module Rails
@name = name
base_name, @class_path, @file_path, @class_nesting, @class_nesting_depth = extract_modules(@name)
@class_name_without_nesting, @singular_name, @plural_name = inflect_names(base_name)
- @table_name = ActiveRecord::Base.pluralize_table_names ? plural_name : singular_name
+ @table_name = (!defined?(ActiveRecord::Base) || ActiveRecord::Base.pluralize_table_names) ? plural_name : singular_name
if @class_nesting.empty?
@class_name = @class_name_without_nesting
else