Chr*_*oph 0 sql ruby-on-rails heroku
我的Rails应用程序在本地和我自己的linux根目录上运行完美(使用sqlite进行测试)
上传到heroku之后,我遇到了一个小问题.
我的一半请求不再有效.
具有".where()"条件的所有请求都被破坏.
这是我的控制器的一个小代码片段:
def GameModeB
ActiveRecord::Base.include_root_in_json = false
@highscore = Highscore.where("gamemode = \"b\"").order("points DESC").limit(100)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @highscore }
format.json { render :json => @highscore}
end
end
Run Code Online (Sandbox Code Playgroud)
这是来自heroku日志的错误日志
2011-12-07T12:21:08+00:00 app[web.1]: LINE 1: ...highscores".* FROM "highscores" WHERE (gamemode = "b") ORDER...
2011-12-07T12:21:08+00:00 app[web.1]: ^
2011-12-07T12:21:08+00:00 app[web.1]: : SELECT "highscores".* FROM "highscores" WHERE (gamemode = "b") ORDER BY points DESC LIMIT 100): 2
Run Code Online (Sandbox Code Playgroud)
问题在哪里("gamemode = \"b \"")
那么什么是正确的陈述,为什么它不适用于heroku呢?谢谢
| 归档时间: |
|
| 查看次数: |
76 次 |
| 最近记录: |