diff options
author | Morgan Schweers <mrs@jobster.com> | 2008-08-20 11:32:20 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-08-09 21:57:56 -0700 |
commit | d2d464e26e9d41b7299675e145ae1455cce37dd4 (patch) | |
tree | 66701fdc7d02f2e42d9d6eaf66dcb108d855ed1c /activerecord/lib/active_record | |
parent | 47f7c936a276269b8bff23bd992fa44e6868abc0 (diff) | |
download | rails-d2d464e26e9d41b7299675e145ae1455cce37dd4.tar.gz rails-d2d464e26e9d41b7299675e145ae1455cce37dd4.tar.bz2 rails-d2d464e26e9d41b7299675e145ae1455cce37dd4.zip |
Fix that creating a table whose primary key prefix type is :table_name generates an incorrectly pluralized primary key.
[#872 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 2473c772e3..94d15fdb69 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -107,7 +107,7 @@ module ActiveRecord # See also TableDefinition#column for details on how to create columns. def create_table(table_name, options = {}) table_definition = TableDefinition.new(self) - table_definition.primary_key(options[:primary_key] || Base.get_primary_key(table_name)) unless options[:id] == false + table_definition.primary_key(options[:primary_key] || Base.get_primary_key(table_name.to_s.singularize)) unless options[:id] == false yield table_definition if block_given? |