[Betternestedset-talk] Don´t bother...
jonas
jonas at fkw.se
Thu May 3 17:25:22 EDT 2007
Don´t bother. I had just forgotten to update my source. I´ve solved it and thank you for taking time. This plugin rocks!
Kind Regards
Jonas
----------------------------------------
Från: "Mark.noten" <mark.noten at itfc.be>
Skickat: den 3 maj 2007 11:22
Till: jonas at fkw.se
Ämne: SPAM-LOW: Re: [Betternestedset-talk] Keep getting the MYSQL-error
Hi Jonas,
I'm not an expert in this but it looks like a part of your query building
method is badly escaped.
? ? "site_id IS NULL" : "site_id = #{site_id}")
Looks like you're trying to do something like below. It's a shorted version
of the "if" syntax.
site_id.nil? "site_id IS NULL" : "site_id = #{site_id}"
Kind regards,
Mark Noten
Zaakvoerder ITFC gcv
E-mail: mark.noten at itfc.be
GSM: 0484/698333
--------- Original Message --------
From: jonas at fkw.se
To: betternestedset-talk at rubyforge.org
Subject: [Betternestedset-talk] Keep getting the MYSQL-error
Date: 02/05/07 23:40
> 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):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}")My apps models:class Node <
ActiveRecord::Base belongs_to :site
acts_as_nested_set :scope => :siteendclass Site <
ActiveRecord::Base has_many :nodes, :dependent =>
:delete_allendColumns in database: create_table "nodes", :force =>
true do |t| t.column
"name",
:string t.column
"parent_id", :integer
t.column
"lft",
:integer t.column
"rgt",
:integer t.column
"site_id", :integer
endWhat am I doing wrong?Best regardsJonas
>
>
>
>
>
> _______________________________________________
> Betternestedset-talk mailing list
> Betternestedset-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/betternestedset-talk
>
________________________________________________
Message sent using UebiMiau 2.7.10
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/betternestedset-talk/attachments/20070503/f2fd5992/attachment.html
More information about the Betternestedset-talk
mailing list