Iīve been working on a site tree with multiple roots for a while now. I just canīt figure out this error (that previously was mentioned here):<br><br><pre>Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? ? "site_id IS NULL" : "site_id = #{site_id}")' at line 1: SELECT max(rgt) AS max_rgt FROM nodes WHERE (site_id.nil? ? "site_id IS NULL" : "site_id = #{site_id}")<br></pre>My apps models:<br><br>class Node &lt; ActiveRecord::Base<br>&nbsp;&nbsp;&nbsp; belongs_to :site<br>&nbsp;&nbsp;&nbsp; acts_as_nested_set :scope =&gt; :site<br>end<br><br>class Site &lt; ActiveRecord::Base<br>&nbsp;&nbsp;&nbsp; has_many :nodes, :dependent =&gt; :delete_all<br>end<br><br>Columns in database:<br>&nbsp; create_table "nodes", :force =&gt; true do |t|<br>&nbsp;&nbsp;&nbsp; t.column "name",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :string<br>&nbsp;&nbsp;&nbsp; t.column "parent_id",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :integer<br>&nbsp;&nbsp;&nbsp; t.column "lft",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :integer<br>&nbsp;&nbsp;&nbsp; t.column "rgt",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :integer<br>&nbsp;&nbsp;&nbsp; t.column "site_id",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :integer<br>&nbsp; end<br><br>What am I doing wrong?<br><br><br>Best regards<br>Jonas<br>