From: PJ Hyett Date: 2006-05-06T04:18:32+09:00 Subject: Re: Help with ActiveRecord Thanks Dave, I had a naming conflict just yesterday as well, I really need to pay closer attention. -PJ On 5/5/06, Dave Lains wrote: > Any field named 'type' is special in Rails, it enables single table > inheritance and is expected to be a character field. Try renaming the > field to 'queue_type' or something along those lines. > > Dave > > Model: > > > > class AdminQueue < ActiveRecord::Base > > set_table_name 'adminqueue' > > end > > > > Interacting with it in script/console > > > >>> AdminQueue.new > > => #nil, > > "resolved"=>nil, "updated_on"=>nil, "action"=>nil, "type"=>nil, > > "post_id"=>nil, "mod_name"=>nil, "count"=>1, "user_id"=>nil, > > "comment"=>nil}, @new_record=true> > > > >>> AdminQueue.find(:all) > > SyntaxError: (eval):1:in `compute_type': compile error > > (eval):1: parse error, unexpected tINTEGER > > Object::0 > > ^ > > from > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1244:in > > > > `compute_type' > > from > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:983:in > > > > `instantiate_without_callbacks' > > from > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/callbacks.rb:215:in > > > > `instantiate' > > from > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:390:in > > > > `find_by_sql' > > from > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:390:in > > > > `find_by_sql' > > from > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:924:in > > > > `find_every' > > from > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:381:in > > > > `find' > > from (irb):7 > > > > Any ideas? > > > > Thanks, > > PJ > > > > >