Skip to content
Browse files

Fixed that model generator would make fixtures plural, even if Active…

…Record::Base.pluralize_table_names was false #1185 [Marcel Molina]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1612 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b94e8af commit dad9c4b2ee0cdc4558c2cb8442eb714fb75ba969 @dhh dhh committed
View
2 railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that model generator would make fixtures plural, even if ActiveRecord::Base.pluralize_table_names was false #1185 [Marcel Molina]
+
* Added a DOCTYPE of HTML transitional to the HTML files generated by Rails #1124 [Michael Koziarski]
* SIGTERM also gracefully exits dispatch.fcgi. Ignore SIGUSR1 on Windows.
View
2 railties/lib/rails_generator/generators/components/model/model_generator.rb
@@ -12,7 +12,7 @@ def manifest
# Model class, unit test, and fixtures.
m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
m.template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
- m.template 'fixtures.yml', File.join('test/fixtures', class_path, "#{table_name}.yml")
+ m.template 'fixtures.yml', File.join('test/fixtures', class_path, "#{ActiveRecord::Base.pluralize_table_names ? plural_name : singular_name}.yml")
end
end
end

0 comments on commit dad9c4b

Please sign in to comment.
Something went wrong with that request. Please try again.