<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: &#8220;Ruby on Rails: Up and Running,&#8221; by Bruce A. Tate and Curt Hibbs</title>
	<atom:link href="http://www.errantdreams.com/reviews/2006/11/23/ruby-on-rails-up-and-running-by-bruce-a-tate-and-curt-hibbs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.errantdreams.com/reviews/2006/11/23/ruby-on-rails-up-and-running-by-bruce-a-tate-and-curt-hibbs/</link>
	<description>650+ book reviews, kitchenware reviews, and more. We may be insane, but we're on your side!</description>
	<pubDate>Thu, 21 Aug 2008 17:32:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Jimmy</title>
		<link>http://www.errantdreams.com/reviews/2006/11/23/ruby-on-rails-up-and-running-by-bruce-a-tate-and-curt-hibbs/#comment-5146</link>
		<dc:creator>Jimmy</dc:creator>
		<pubDate>Wed, 10 Oct 2007 23:48:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.errantdreams.com/reviews/?p=493#comment-5146</guid>
		<description>I like this book because it is short, thin, and to the point.  It gives me just enough information to get started.  The examples worked fine until I tried the drag &#38; drop one.

This is probably not the place to ask a question like this.  But, please let me...

The error from drag &#38; drop operation:

Processing SlideshowsController#add_photo (for 10.71.1.169 at 2007-10-10 14:44:43) [POST]
  Session ID: 253902577ac03cf8a5c6393c3721dade
  Parameters: {"action"=&#62;"add_photo", "id"=&#62;"photo_3", "controller"=&#62;"slideshows"}
  [4;35;1mSQL (0.002208)[0m   [0m SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
 FROM pg_attribute a LEFT JOIN pg_attrdef d
 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
 WHERE a.attrelid = 'slides'::regclass
 AND a.attnum &#62; 0 AND NOT a.attisdropped
 ORDER BY a.attnum
[0m
  [4;36;1mSQL (0.000436)[0m   [0;1mBEGIN[0m
  [4;35;1mSlide Load (0.000000)[0m   [0mRuntimeError: ERROR	C42804	Margument of WHERE must be type boolean, not type integer	Fparse_coerce.c	L818	Rcoerce_to_boolean: SELECT * FROM slides WHERE (slideshow_id) ORDER BY position DESC LIMIT 1[0m
  [4;36;1mSQL (0.000429)[0m   [0;1mROLLBACK[0m

ActiveRecord::StatementInvalid (RuntimeError: ERROR	C42804	Margument of WHERE must be type boolean, not type integer	Fparse_coerce.c	L818	Rcoerce_to_boolean: SELECT * FROM slides WHERE (slideshow_id)  ORDER BY position DESC LIMIT 1):
........

Based on the above error, the problem seems to be with the generated select statement.

SELECT * FROM slides WHERE (slideshow_id)  ORDER BY position DESC LIMIT 1)

Instead, it should be:

SELECT * FROM slides WHERE (slideshow_id = 3)  ORDER BY position DESC LIMIT 1)

I also tried the following:

&#62;&#62; slide = Slide.find 1
&#62;&#62; slideshow = slide.slideshow
&#62;&#62; slideshow.slides.first.move_to_bottom
ActiveRecord::StatementInvalid: RuntimeError: ERROR     C42804  Margument of AND must be type boolean, not type integer Fparse_coerce.c L818    Rcoerce_to_boolean: UPDATE slides SET position = (position - 1) WHERE (slideshow_id AND position &#62; 1)

Same kind of problem.  The update statement should be like:

UPDATE slides SET position = (position - 1) WHERE (slideshow_id = 3 AND position &#62; 1)

I am not sure how to correct this problem.  I understand that you finished this book more than 10 months ago, if you still have the example in your computer somewhere, please help.  Thank you very much.</description>
		<content:encoded><![CDATA[<p>I like this book because it is short, thin, and to the point.  It gives me just enough information to get started.  The examples worked fine until I tried the drag &amp; drop one.</p>
<p>This is probably not the place to ask a question like this.  But, please let me&#8230;</p>
<p>The error from drag &amp; drop operation:</p>
<p>Processing SlideshowsController#add_photo (for 10.71.1.169 at 2007-10-10 14:44:43) [POST]<br />
  Session ID: 253902577ac03cf8a5c6393c3721dade<br />
  Parameters: {&#8221;action&#8221;=&gt;&#8221;add_photo&#8221;, &#8220;id&#8221;=&gt;&#8221;photo_3&#8243;, &#8220;controller&#8221;=&gt;&#8221;slideshows&#8221;}<br />
  [4;35;1mSQL (0.002208)[0m   [0m SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull<br />
 FROM pg_attribute a LEFT JOIN pg_attrdef d<br />
 ON a.attrelid = d.adrelid AND a.attnum = d.adnum<br />
 WHERE a.attrelid = &#8217;slides&#8217;::regclass<br />
 AND a.attnum &gt; 0 AND NOT a.attisdropped<br />
 ORDER BY a.attnum<br />
[0m<br />
  [4;36;1mSQL (0.000436)[0m   [0;1mBEGIN[0m<br />
  [4;35;1mSlide Load (0.000000)[0m   [0mRuntimeError: ERROR	C42804	Margument of WHERE must be type boolean, not type integer	Fparse_coerce.c	L818	Rcoerce_to_boolean: SELECT * FROM slides WHERE (slideshow_id) ORDER BY position DESC LIMIT 1[0m<br />
  [4;36;1mSQL (0.000429)[0m   [0;1mROLLBACK[0m</p>
<p>ActiveRecord::StatementInvalid (RuntimeError: ERROR	C42804	Margument of WHERE must be type boolean, not type integer	Fparse_coerce.c	L818	Rcoerce_to_boolean: SELECT * FROM slides WHERE (slideshow_id)  ORDER BY position DESC LIMIT 1):<br />
&#8230;&#8230;..</p>
<p>Based on the above error, the problem seems to be with the generated select statement.</p>
<p>SELECT * FROM slides WHERE (slideshow_id)  ORDER BY position DESC LIMIT 1)</p>
<p>Instead, it should be:</p>
<p>SELECT * FROM slides WHERE (slideshow_id = 3)  ORDER BY position DESC LIMIT 1)</p>
<p>I also tried the following:</p>
<p>&gt;&gt; slide = Slide.find 1<br />
&gt;&gt; slideshow = slide.slideshow<br />
&gt;&gt; slideshow.slides.first.move_to_bottom<br />
ActiveRecord::StatementInvalid: RuntimeError: ERROR     C42804  Margument of AND must be type boolean, not type integer Fparse_coerce.c L818    Rcoerce_to_boolean: UPDATE slides SET position = (position - 1) WHERE (slideshow_id AND position &gt; 1)</p>
<p>Same kind of problem.  The update statement should be like:</p>
<p>UPDATE slides SET position = (position - 1) WHERE (slideshow_id = 3 AND position &gt; 1)</p>
<p>I am not sure how to correct this problem.  I understand that you finished this book more than 10 months ago, if you still have the example in your computer somewhere, please help.  Thank you very much.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
