aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/comment.rb
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2016-01-30 16:47:51 +0900
committeryui-knk <spiketeika@gmail.com>2016-01-30 16:47:51 +0900
commit444c4d05fea817fcad991e79fa128b640e2e4ff1 (patch)
tree442c6ef8de128d9828637249d613e1ada0203868 /activerecord/test/models/comment.rb
parent6162c49e40582bf058a6bb82ccc0cfb8f92332b6 (diff)
downloadrails-444c4d05fea817fcad991e79fa128b640e2e4ff1.tar.gz
rails-444c4d05fea817fcad991e79fa128b640e2e4ff1.tar.bz2
rails-444c4d05fea817fcad991e79fa128b640e2e4ff1.zip
Warn if `AR.primary_key` is called for a table who has composite primary key
If `AR.primary_key` is called for a table who has composite primary key, the method returns `nil`. This behavior sometimes generates invalid SQL. The first time developers notice to invalid SQL is when they execute SQL. This commit enables developers to know they are doing something dangerous as soon as possible.
Diffstat (limited to 'activerecord/test/models/comment.rb')
0 files changed, 0 insertions, 0 deletions