Displaying 2 results from an estimated 2 matches for "slideshow_id".
2007 Feb 19
0
Invalid SQL generated with PostgreSQL 8.2.3
...19:41:30.703"}>
>> show.slides.first.photo.filename
=> "balboa_park.jpg"
>> show.slides.first.move_to_bottom
ActiveRecord::StatementInvalid: PGError: ERROR: argument of AND must
be type boolean, not type integer
: UPDATE slides SET position = (position - 1) WHERE (slideshow_id AND
position > 1)
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/
active_record/connection_adapters/abstract_adapter.rb:128:in `log''
from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/
active_record/connection_adapters/postgresql_adapter.rb:152:in
`execut...
2008 Mar 15
1
error on belongs_to method.
I followed the Ruby on Rails up and running book published by Orielly.
there are three DB tables, photo, slideshow, and slide
the Slide class in slide.rb is like this:
class Slide < ActiveRecord::Base
belongs_to :photo :foreign_key =>photo_id
belongs_to :slideshow :foreign_key=>slideshow_id
end
I inserted the sample data into database. When I trying to run the
command on page39:
slide= Slide.find 1
it give me the following error:
../slide.rb:2: syntax error, unexpected '';'', expecting kEND.
and the same with ../slide.rb:3
can anybody help me? if you can tell me how...