ActiveRecord :: StatementInvalid SQLite3 :: SQLException: такого столбца нет: true:

Я хочу, чтобы @messages возвращали @ folder.messages, где значение столбца «удалено» НЕ равно true. Я не уверен, почему это продолжает вызывать исключение SQLException. Думаю, я неправильно форматирую удаленный атрибут, но не знаю, как это исправить.

Любая помощь будет принята с благодарностью. Заранее спасибо.

Сообщение об ошибке:

ActiveRecord::StatementInvalid in MailboxController#index  
SQLite3::SQLException: no such column: true: SELECT     "message_copies".* FROM       "message_copies"  WHERE     ("message_copies".folder_id = 1) AND (deleted != true)  

Трассировка приложения:

app/controllers/mailbox_controller.rb:14:in `show'  
app/controllers/mailbox_controller.rb:5:in `index'  

Mailbox_Controller. rb

1   class MailboxController < ApplicationController  
2     def index  
3       current_user = User.find(session[:user_id])  
4       @folder = Folder.where("user_id = #{current_user.id}").first  
5       show  
6       render :action => "show"  
7     end
8  
9     def show  
10      current_user = User.find(session[:user_id])  
11      @folder = Folder.where("user_id = #{current_user.id}").first  
12      @msgs = @folder.messages  
13      @ms = @msgs.where("deleted != true")  
14      @messages = @ms.all.paginate :per_page => 10,  
15                 :page => params[:page], :include => :message,  
16                 :order => "messages.created_at DESC"  
17    end  
18  end  
7
задан mu is too short 22 January 2013 в 18:16
поделиться