We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ce3c21 commit 0516806Copy full SHA for 0516806
activerecord/lib/active_record/attribute_methods/primary_key.rb
@@ -24,14 +24,14 @@ def reset_primary_key #:nodoc:
24
end
25
26
def get_primary_key(base_name) #:nodoc:
27
- key = 'id'
28
case primary_key_prefix_type
29
- when :table_name
30
- key = base_name.to_s.foreign_key(false)
31
- when :table_name_with_underscore
32
- 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
33
+ 'id'
34
- key
35
36
37
# Sets the name of the primary key column to use to the given value,
0 commit comments