I have a following models:
class Chart < ActiveRecord::Base
class GlTransaction < ActiveRecord::Base
class GeneralLedger < ActiveRecord::Base
has_many :charts, :through => :gl_transactions
In general_ledger_controller I have a some standard find clause with
counter = GeneralLedger.count( :order => order, :conditions => ['charts.id =
:include => ‘charts’ )
By some mysterious reason it returns me a following message:
RuntimeError: ERROR C42804 Margument of WHERE must be type boolean, not
Rcoerce_to_boolean: SELECT COUNT(DISTINCT general_ledgers.id) FROM
LEFT OUTER JOIN transactions ON transactions.general_ledger_id =
LEFT OUTER JOIN charts ON charts.id = transactions.chart_id WHERE
I cannot understand why Where clause was overwritten with :include data?
Can someone help me with this?
All the Best!