Mysterious error: "uninitialized constant ActiveRecord::Base::User"

1,348 views
Skip to first unread message

Joe Carroll

unread,
Aug 10, 2008, 3:45:12 PM8/10/08
to ActiveScaffold : Ruby on Rails plugin
Hi

I'm quite new to Rails and to ActiveScaffold. I'm working on a tight
deadline to build a database web app to manage a computer repair shop
where I work, so some help would be greatly appreciated. I'm using
Goldberg ( http://goldberg.240gl.org/ ) to manage users, layout and
content, and want to use ActiveScaffold for dynamic in-page management
of the actual data. After an initially positive and productive start
I've hit a brick wall with this frustrating problem. I've looked for
similar experiences on this group, and found many posts with similar
errors, but none quite the same. Most of those seem to involve complex
inter-table relationships, whereas my models are quite simple (for the
time being). The crazy thing is that I have one resource that
continues to work correctly even though the broken ones are configured
almost identically!

Thanks in advance for your help.
Joe

The error I get is as follows:

NameError in MachinesController#index
uninitialized constant ActiveRecord::Base::User

Full Trace
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:492:in `const_missing_before_generators'
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/rails_generator/lookup.rb:
15:in `const_missing'
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
base.rb:1909:in `compute_type'
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
reflection.rb:129:in `send'
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
reflection.rb:129:in `klass'
vendor/plugins/active_scaffold/lib/actions/nested.rb:41:in
`links_for_associations'
vendor/plugins/active_scaffold/lib/data_structures/action_columns.rb:
68:in `each'
vendor/plugins/active_scaffold/lib/data_structures/action_columns.rb:
55:in `each'
vendor/plugins/active_scaffold/lib/actions/nested.rb:32:in
`links_for_associations'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
callbacks.rb:173:in `send'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
callbacks.rb:173:in `evaluate_method'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
callbacks.rb:161:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
filters.rb:430:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
filters.rb:592:in `run_before_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
filters.rb:578:in `call_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
filters.rb:573:in `perform_action_without_benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
benchmarking.rb:68:in `perform_action_without_rescue'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/benchmark.rb:293:in `measure'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
benchmarking.rb:68:in `perform_action_without_rescue'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
rescue.rb:201:in `perform_action_without_caching'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
caching/sql_cache.rb:13:in `perform_action'
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/query_cache.rb:33:in `cache'
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/
query_cache.rb:8:in `cache'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
caching/sql_cache.rb:12:in `perform_action'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:529:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:529:in `process_without_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
filters.rb:569:in `process_without_session_management_support'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
session_management.rb:130:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:389:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:149:in `handle_request'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:107:in `dispatch'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:104:in `synchronize'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:104:in `dispatch'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:120:in `dispatch_cgi'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:35:in `dispatch'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in
`process'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in
`synchronize'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in
`process'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
`process_client'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`process_client'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`initialize'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`initialize'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:
282:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:
281:in `each'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:
281:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in
`run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:
212:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:502:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:502:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:354:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:502:in `load'
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/commands/servers/
mongrel.rb:64
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:354:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
Request

Parameters:

None
Show session dump

---
:csrf_id: 9337a604d3f1086533ab4a3a6307eb34
:last_time: 2008-08-10 21:56:29.174980 +03:00
as:customers:
:list: {}

as:machines:
:list: {}

flash: !map:ActionController::Flash::FlashHash {}

:goldberg:
:path: /machines
:menu_item: setup/controllers
:user_id: 2
:menu_history:
/customers/list: Customers
/admin: admin
/goldberg/site_controllers/new_called/machines: setup/controllers
/goldberg/site_controllers/new_called/cases: setup/controllers
/menu/Customers: admin
/goldberg/auth/login:
/denied: Customers
/goldberg/site_controllers/new_called/parts: setup/controllers
/goldberg/site_controllers/show/15: setup/controllers
/goldberg/site_controllers/new_called/notes: setup/controllers
/goldberg/site_controllers/destroy/15: setup/controllers
/goldberg/site_controllers/new: setup/controllers
/goldberg/site_controllers/list: setup/controllers
/goldberg/site_controllers/new_called/service_cases: setup/
controllers
/menu/admin:
/menu/setup/controllers: setup
/goldberg/site_controllers/create: setup/controllers
/machines: Customers
/site_admin: setup
/menu/setup: admin
Response

Headers:

{"cookie"=>[],
"Cache-Control"=>"no-cache"}

************************************************************************************
This works correctly:

contollers/customers_controller.rb:

class CustomersController < ApplicationController
# layout "customers"
layout "application"
active_scaffold :customers

active_scaffold :customers do |config|
config.label = "Customers"
config.columns =
[:name, :contact_person, :email, :phone_number, :address_1]
list.columns.exclude :country
list.sorting = {:name => 'ASC'}
columns[:phone_number].label = "Phone #"
columns[:phone_number].description = "(Format: +###-##-#######)"
end
end

models/customer.rb
class Customer < ActiveRecord::Base
[:name, :email, :phone_number].each do |field|
validates_presence_of field
end
end

But for some reason this doesn't:
controllers/machines_controller.rb:
class MachinesController < ApplicationController
# layout "machines"
layout "application"
active_scaffold :machines

active_scaffold :customers do |config|
config.label = "Apple Device"
list.sorting = {:updated_at => 'ASC'}
end
end

models/machine.rb:
class Machine < ActiveRecord::Base
validates_presence_of :serial_number, :on => :create, :message =>
"can't be blank"
validates_uniqueness_of :serial_number, :on => :create, :message =>
"this serial number is already registered on the database!"
end

Joe Carroll

unread,
Aug 10, 2008, 3:57:14 PM8/10/08
to ActiveScaffold : Ruby on Rails plugin
Just to add a few more details about my environment:
Mac OS X 10.5.4 on Intel
ruby 1.8.6 patchlevel 114
rails 2.1.0
activescaffold 1.2RC1 (from git://github.com/activescaffold/active_scaffold.git)
goldberg (current rails-2.1-compatible version from git://github.com/urbanus/goldberg.git)

installed plugins (not all in use):
active_record_defaults
active_scaffold
acts_as_ferret
annotate_models
attachment_fu
debug-view-helper
exception_logger
goldberg
has_many_polymorphs
query_trace
restful_authentication
spider_test
userstamp

installed gems:
actionmailer (2.1.0, 2.0.2, 1.3.6, 1.3.3)
actionpack (2.1.0, 2.0.2, 1.13.6, 1.13.3)
actionwebservice (1.2.6, 1.2.3)
activerecord (2.1.0, 2.0.2, 1.15.6, 1.15.3)
activeresource (2.1.0, 2.0.2)
activesupport (2.1.0, 2.0.2, 1.4.4, 1.4.2)
acts_as_ferret (0.4.3, 0.4.1)
archive-tar-minitar (0.5.2)
arrayfields (4.6.0)
bencode (0.5.0)
capistrano (2.4.3, 2.3.0, 2.0.0)
cgi_multipart_eof_fix (2.5.0, 2.2)
cheat (1.2.1)
color (1.4.0)
columnize (0.1)
daemons (1.0.10, 1.0.9, 1.0.7)
dnssd (0.6.0)
fastthread (1.0.1, 1.0)
fattr (1.0.3)
fcgi (0.8.7)
ferret (0.11.6, 0.11.4)
gem_plugin (0.2.3, 0.2.2)
git (1.0.5)
git-rails (0.2.1)
github (0.1.1)
gruff (0.3.1)
haml (2.0.2)
has_finder (0.1.5)
has_many_through_generator (0.4.0)
highline (1.4.0, 1.2.9)
hoe (1.7.0)
hpricot (0.6.161, 0.6)
httpclient (2.1.2)
libxml-ruby (0.8.3, 0.5.4, 0.3.8.4)
linecache (0.43)
main (2.8.2)
mongrel (1.1.5, 1.1.4, 1.0.1)
mysql (2.7)
needle (1.3.0)
net-scp (1.0.1)
net-sftp (2.0.1, 2.0.0, 1.1.0)
net-ssh (2.0.3, 2.0.2, 2.0.1, 1.1.2)
net-ssh-gateway (1.0.0)
osx-trash (1.0.0)
passenger (2.0.3, 2.0.2, 1.0.5)
rack (0.3.0)
rails (2.1.0, 2.0.2, 1.2.6, 1.2.3)
rake (0.8.1, 0.7.3)
rapt (0.2.2)
RedCloth (4.0.1, 3.0.4)
redgreen (1.2.2)
rmagick (2.5.2)
rspec (1.1.4)
ruby-debug (0.10.1)
ruby-debug-base (0.10.1)
ruby-openid (2.1.2, 2.0.4, 1.1.4)
ruby-yadis (0.3.4)
rubyforge (1.0.0)
rubygems-update (1.2.0, 1.1.1)
rubynode (0.1.5, 0.1.3)
schacon-ticgit (0.3.5, 0.3.4)
sinatra (0.2.2)
soap4r (1.5.8)
sources (0.0.1)
sqlite3-ruby (1.2.2, 1.2.1)
termios (0.9.4)
tzinfo (0.3.9)
wirble (0.1.2)

Joe Carroll

unread,
Aug 10, 2008, 4:20:02 PM8/10/08
to actives...@googlegroups.com
here's how it looks when it works:
Picture 1.png

Joe Carroll

unread,
Aug 10, 2008, 4:33:02 PM8/10/08
to ActiveScaffold : Ruby on Rails plugin
sorry for spamming. just wanted to add that i did already notice and
fix the typo where machines_controller.rb was enumerating
active_scaffold :customers by mistake, but fixing it didn't help my
problem :-(

Joe Carroll

unread,
Aug 12, 2008, 10:48:12 AM8/12/08
to ActiveScaffold : Ruby on Rails plugin
Can anyone PLEASE offer some help with this? Is there a bug in the
current github-hosted version of ActiveRecord under Rails 2.1 that
could be causing this? I've noticed there's a TODO in the comments
above the method that ends up raising the exception...

My debugging efforts have identified line 32 of active_scaffold/lib/
actions/nested.rb ( "active_scaffold_config.list.columns.each do |
column|" in the module's method links_for_associations ) as the point
where the exception is raised:

Breakpoint 1 at /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb:173
1: method = links_for_associations
2: object.class = MachinesController
3: args =
4: block =
[168, 177] in /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/
active_support/callbacks.rb
168 private
169 def evaluate_method(method, *args, &block)
170 case method
171 when Symbol
172 object = args.shift
=> 173 object.send(method, *args, &block)
174 when String
175 eval(method, args.first.instance_eval
{ binding })
176 when Proc, Method
177 method.call(*args, &block)
(rdb:51) c
Breakpoint 2 at /Users/joecarroll/dev/ruby/rails/aaspdb/vendor/plugins/
active_scaffold/lib/actions/nested.rb:32
1: method =
2: object.class =
3: args =
4: block =
[27, 36] in /Users/joecarroll/dev/ruby/rails/aaspdb/vendor/plugins/
active_scaffold/lib/actions/nested.rb
27 end
28
29 # Create the automatic column links. Note that this has to
happen when configuration is *done*, because otherwise the Nested
module could be disabled. Actually, it could still be disabled later,
couldn't it?
30 # TODO: This should really be a post-config routine,
instead of a before_filter.
31 def links_for_associations
=> 32 active_scaffold_config.list.columns.each do |column|
33 # if column.link == false we won't create a link.
that's how a dev can suppress the auto links.
34 if column.association and column.link.nil?
35 if column.plural_association?
36 # note: we can't create nested scaffolds
on :through associations because there's no reverse association.
(rdb:51) v i active_scaffold_config
@action_configs = {:nested=>#<ActiveScaffold::Config::Nested:0x43f2484
@core=#<ActiveScaffold::...
@action_links = #<ActiveScaffold::DataStructures::ActionLinks:
0x43f6868 @set=[#<ActiveScaffol...
@actions = #<ActiveScaffold::DataStructures::Actions:0x445f584
@set=[:create, :list, :se...
@columns = #<ActiveScaffold::DataStructures::Columns:0x43fab34
@set=[#<ActiveScaffold::D...
@frontend = :default
@inherited_view_paths = []
@label = "Machines"
@model = Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_n...
@model_id = "machine"
@theme = :default
(rdb:51) pp active_scaffold_config.columns
#<ActiveScaffold::DataStructures::Columns:0x43fab34

@_inheritable=[:model, :serial_number, :warranty, :creator, :updater],
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id: integer,
serial_number: string, model: string, warranty: boolean, created_at:
datetime, updated_at: datetime),
@set=
[#<ActiveScaffold::DataStructures::Column:0x43fa97c
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fb6ec
@default=nil,
@limit=nil,
@name="created_at",
@null=true,
@precision=nil,
@primary=false,
@scale=nil,
@sql_type="datetime",
@type=:datetime>,
@css_class="",
@field="machines.\"created_at\"",
@includes=[],
@label="Created at",
@name=:created_at,
@required=false,
@search_sql="machines.\"created_at\"",
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43fa288
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fc060
@default=nil,
@limit=nil,
@name="customer_id",
@null=true,
@precision=nil,
@primary=false,
@scale=nil,
@sql_type="integer",
@type=:integer>,
@css_class="",
@field="machines.\"customer_id\"",
@includes=[],
@label="Customer",
@name=:customer_id,
@required=false,
@search_sql="machines.\"customer_id\"",
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f9eb4
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fc4e8
@default=nil,
@limit=nil,
@name="id",
@null=false,
@precision=nil,
@primary=true,
@scale=nil,
@sql_type="INTEGER",
@type=:integer>,
@css_class="",
@field="machines.\"id\"",
@includes=[],
@label="Id",
@name=:id,
@required=false,
@search_sql="machines.\"id\"",
@sort={:sql=>"machines.\"id\""},
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f9a68
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fbb9c
@default=nil,
@limit=255,
@name="model",
@null=true,
@precision=nil,
@primary=false,
@scale=nil,
@sql_type="varchar(255)",
@type=:string>,
@css_class="",
@field="machines.\"model\"",
@includes=[],
@label="Model",
@name=:model,
@required=false,
@search_sql="machines.\"model\"",
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f95e0
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fbe1c
@default=nil,
@limit=255,
@name="serial_number",
@null=true,
@precision=nil,
@primary=false,
@scale=nil,
@sql_type="varchar(255)",
@type=:string>,
@css_class="",
@field="machines.\"serial_number\"",
@includes=[],
@label="Serial number",
@name=:serial_number,
@required=false,
@search_sql="machines.\"serial_number\"",
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f90a4
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fc2a4
@default=nil,
@limit=nil,
@name="service_case_id",
@null=true,
@precision=nil,
@primary=false,
@scale=nil,
@sql_type="integer",
@type=:integer>,
@css_class="",
@field="machines.\"service_case_id\"",
@includes=[],
@label="Service case",
@name=:service_case_id,
@required=false,
@search_sql="machines.\"service_case_id\"",
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f8b18
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fb4a8
@default=nil,
@limit=nil,
@name="updated_at",
@null=true,
@precision=nil,
@primary=false,
@scale=nil,
@sql_type="datetime",
@type=:datetime>,
@css_class="",
@field="machines.\"updated_at\"",
@includes=[],
@label="Updated at",
@name=:updated_at,
@required=false,
@search_sql="machines.\"updated_at\"",
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f8514
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=nil,
@column=
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x43fb930
@default=nil,
@limit=nil,
@name="warranty",
@null=true,
@precision=nil,
@primary=false,
@scale=nil,
@sql_type="boolean",
@type=:boolean>,
@css_class="",
@field="machines.\"warranty\"",
@includes=[],
@label="Warranty",
@name=:warranty,
@required=false,
@search_sql="machines.\"warranty\"",
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f7e70
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=
#<ActiveRecord::Reflection::AssociationReflection:0x1857a7c
@active_record=ActiveRecord::Base,
@class_name="User",
@macro=:belongs_to,
@name=:creator,
@options={:class_name=>"User", :foreign_key=>:creator_id},
@primary_key_name=:creator_id>,
@column=nil,
@css_class="",
@includes=[:creator],
@label="Creator",
@name=:creator,
@required=false,
@search_sql=nil,
@sort=true,
@table="machines">,
#<ActiveScaffold::DataStructures::Column:0x43f7600
@active_record_class=
Machine(id: integer, service_case_id: integer, customer_id:
integer, serial_number: string, model: string, warranty: boolean,
created_at: datetime, updated_at: datetime),
@association=
#<ActiveRecord::Reflection::AssociationReflection:0x1856938
@active_record=ActiveRecord::Base,
@macro=:belongs_to,
@name=:updater,
@options={:class_name=>"User", :foreign_key=>:updater_id}>,
@column=nil,
@css_class="",
@includes=[:updater],
@label="Updater",
@name=:updater,
@required=false,
@search_sql=nil,
@sort=true,
@table="machines">]>
(rdb:51) n
1: method =
2: object.class =
3: args =
4: block =
[198, 207] in /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/rescue.rb
198
199 private
200 def perform_action_with_rescue #:nodoc:
201 perform_action_without_rescue
202 rescue Exception => exception
=> 203 rescue_action_with_handler(exception) ||
rescue_action(exception)
204 end
205
206 def rescues_path(template_name)
207 "#{File.dirname(__FILE__)}/templates/rescues/
#{template_name}.erb"
(rdb:51) pp exception
#<NameError: uninitialized constant ActiveRecord::Base::User>
(rdb:51) where
--> #0 ActionController::Rescue.perform_action_without_caching
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/rescue.rb:203
#1 ActiveRecord::ConnectionAdapters::QueryCache.perform_action
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/caching/sql_cache.rb:13
#2 ActiveRecord::QueryCache.cache
at line /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/
active_record/query_cache.rb:8
#3 ActionController::Caching::SqlCache.perform_action
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/caching/sql_cache.rb:12
#4 Kernel.send(request#ActionController::Cgi...)
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:529
#5
ActionController::Base.process_without_filters(request#ActionController::Cgi...,...)
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:529
#6
ActionController::Filters::InstanceMethods.process_without_session_management_support(request#ActionController::Cgi...,...)
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/filters.rb:569
#7
ActionController::SessionManagement.process(request#ActionController::Cgi...,...)
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/session_management.rb:130
#8
ActionController::Base.initialize(request#ActionController::Cgi...,
response#ActionController::Cgi...,...)
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:389
#9 ActionController::Dispatcher.handle_request
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:149
#10 Mutex.dispatch
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:107
#11 ActionController::Dispatcher.dispatch
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:104
#12
ActionController::Dispatcher.dispatch_cgi(cgi#Mongrel::CGIWrapper,
session_options#Hash,...)
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:120
#13 ActionController::Dispatcher.new(cgi#Mongrel::CGIWrapper,
session_options#Hash,...)
at line /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:35
#14 Mutex.process
at line /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
rails.rb:76
#15
Mongrel::Rails::RailsHandler.process(request#Mongrel::HttpRequest,
response#Mongrel::HttpResponse,...)
at line /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
rails.rb:74
#16 Array.process_client
at line /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/
mongrel.rb:159
#17 Mongrel::HttpServer.process_client(client#TCPSocket)
at line /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/
mongrel.rb:158
#18 Mongrel::HttpServer.run
at line /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/
mongrel.rb:285

Joe Carroll

unread,
Aug 12, 2008, 4:34:19 PM8/12/08
to ActiveScaffold : Ruby on Rails plugin
My problem is solved, thanks to a suggestion on the Goldberg users'
group :-) The problem was apparently caused by an automatically
enabled plugin I had installed. I moved all but the essential plugins
to a "Disabled Plugins" folder for now and will leave figuring out
exactly which plugin was at fault to a later stage. Userstamp seems
the most likely culprit. I guess restful_authentication is made
unnecessary by my use of Goldberg and its user management system,
although I would like to get userstamp or equivalent functionality
working at some point. I'm glad that I haven't been forced to ditch
ActiveScaffold... yet...
Reply all
Reply to author
Forward
0 new messages