DEPRECATION WARNING: Dangerous query method: Random Record in ActiveRecord >= 5.2

前端 未结 3 1801
长发绾君心
长发绾君心 2020-11-29 12:13

So far, the \"common\" way to get a random record from the Database has been:

# Postgress
Model.order(\"RANDOM()\").first 

# MySQL
Model.order(\"RAND()\").f         


        
3条回答
提交回复
热议问题