Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ActiveRecord::StatementInvalid in ImageboardController#index
- Mysql::Error: #23000Column 'parent_id' in where clause is ambiguous: SELECT COUNT(DISTINCT comments.id) FROM comments LEFT OUTER JOIN comments childrens_comments ON childrens_comments.parent_id = comments.id WHERE (parent_id IS NULL && board_id = 1)
- class ImageboardController < ApplicationController
- def index
- @pages, @parents =
- paginate( :comments,
- :include => [:children],
- :per_page => @board.setting(:threads_per_page),
- :conditions => "parent_id IS NULL && board_id = #{@board.id}",
- :order => "bumped_on DESC")
- end
- end
- require 'cgi'
- require 'digest/md5'
- require 'RMagick'
- include Magick
- class Comment < ActiveRecord::Base
- belongs_to :board
- acts_as_tree :order => "created_on ASC", :dependent => :destroy
- end
Add Comment
Please, Sign In to add comment