我有一段代码在开发环境中运行良好,并在生产中引发错误。这里是:
venue.badges.where(:active => true).select([:title, :desc, :bonus]).each do |badge|
在处理 MySQL 本地数据库时,它会在生产环境中触发:
ActiveRecord::StatementInvalid (PG::Error: ERROR: syntax error at or near "desc"
: SELECT title, desc, bonus FROM "badges" WHERE "badges"."venue_id" = 22 AND "badges"."active" = 't'):
LINE 1: SELECT title, desc, bonus FROM "badges" WHERE "badges"."ven...
我真的不明白这里有什么问题。