BG

shinjiko インストール(3)

前回, sqlite のエラーで止まりましたので, その部分を修正します。

エラーの原因はログに出ていた通り, 'ORDER BY' 句で使用している 'updated_at' カラムが 'issues' or 'members' テーブルのどちらの物か曖昧なことが原因です。(ちょっと良く判らないのですが, ここでエラーになるのは sqlite 特有なのでしょうか? MySQLPostgreSQL の環境が手元にないので, 確認できてません)

直し方は色々あると思うのですが, 今回は画面表示時のソート順なので view 側に手を入れるのが妥当でしょうか。

$ diff app/views/issue/index.html.erb.org app/views/issue/index.html.erb
45c45
<    issues = self.current_user.reviews.find(:all, :conditions => ['closed = 0'], :order => 'updated_at desc')
---
>    issues = self.current_user.reviews.find(:all, :conditions => ['closed = 0'], :order => 'issues.updated_at desc')
85c85
<    issues = self.current_user.reviews.find(:all, :conditions => ['closed = 1'], :order => 'updated_at desc')
---
>    issues = self.current_user.reviews.find(:all, :conditions => ['closed = 1'], :order => 'issues.updated_at desc')

一応, パッチを投げておきましたが, 作者の正式な修正が出たら, そちらを使いましょう :-)


これで, 一先ずは動く筈です。
ただし, 少し触ってみた所, 入力チェックの甘い所があるようなので (前回 production でも development でも好きな方で動かせば良いと書いてしまいましたが) 操作の判らない内は development で動かす方がお勧めです。(production だと一見, 上手く動いているように見えて, 実は駄目ですと言うことがあったので)