Skip to content

Commit 0516806

Browse files
committed
remove some lasigns
1 parent 3ce3c21 commit 0516806

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

activerecord/lib/active_record/attribute_methods/primary_key.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ def reset_primary_key #:nodoc:
2424
end
2525

2626
def get_primary_key(base_name) #:nodoc:
27-
key = 'id'
2827
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
28+
when :table_name
29+
base_name.to_s.foreign_key(false)
30+
when :table_name_with_underscore
31+
base_name.to_s.foreign_key
32+
else
33+
'id'
3334
end
34-
key
3535
end
3636

3737
# Sets the name of the primary key column to use to the given value,

0 commit comments

Comments
 (0)