aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r--activerecord/lib/active_record/attribute_methods/primary_key.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb
index 75ae06f5e9..a10e94d5f7 100644
--- a/activerecord/lib/active_record/attribute_methods/primary_key.rb
+++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb
@@ -24,14 +24,14 @@ module ActiveRecord
end
def get_primary_key(base_name) #:nodoc:
- key = 'id'
case primary_key_prefix_type
- when :table_name
- key = base_name.to_s.foreign_key(false)
- when :table_name_with_underscore
- key = base_name.to_s.foreign_key
+ when :table_name
+ base_name.to_s.foreign_key(false)
+ when :table_name_with_underscore
+ base_name.to_s.foreign_key
+ else
+ 'id'
end
- key
end
# Sets the name of the primary key column to use to the given value,