Forum: Ruby on Rails Help with ActiveRecord

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
PJ Hyett (Guest)
on 2006-05-05 21:45
(Received via mailing list)
Model:

class AdminQueue < ActiveRecord::Base
 set_table_name 'adminqueue'
end

Interacting with it in script/console

>> AdminQueue.new
=> #<AdminQueue:0x240a910 @attributes={"topic_id"=>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
PJ Hyett (Guest)
on 2006-05-05 23:18
(Received via mailing list)
Disregard, it was the name of the "type" field.

-PJ
This topic is locked and can not be replied to.