mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Table names aren't nested: replace / with _ to match the likely table name.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
ace7518fcb
commit
24c9250968
1 changed files with 1 additions and 0 deletions
|
@ -230,6 +230,7 @@ module Rails
|
||||||
base_name, @class_path, @file_path, @class_nesting, @class_nesting_depth = extract_modules(@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)
|
@class_name_without_nesting, @singular_name, @plural_name = inflect_names(base_name)
|
||||||
@table_name = (!defined?(ActiveRecord::Base) || ActiveRecord::Base.pluralize_table_names) ? plural_name : singular_name
|
@table_name = (!defined?(ActiveRecord::Base) || ActiveRecord::Base.pluralize_table_names) ? plural_name : singular_name
|
||||||
|
@table_name.gsub! '/', '_'
|
||||||
if @class_nesting.empty?
|
if @class_nesting.empty?
|
||||||
@class_name = @class_name_without_nesting
|
@class_name = @class_name_without_nesting
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue