#51
New
Bug in pluralize for legacy table
Reported by ComputerMage on Ajax Scaffold · 27/09/2006 20:05:18
- Assigned to:
- rrwhite
- Priority:
- Normal
- Status:
- New
- Category:
- None
- Version:
- 3.1.9
Hi there!
I wanted to share the problem. It looks like pluralize doesn’t work with legacy tables.
I think that the good idea is to depend not in pluralize but on actual data from derived class.
class Chart < ActiveRecord::Base
set_table_name ‘chart’
end
Here is the error.
ActiveRecord::StatementInvalid in ChartController#tablePGError: ERROR: missing FROM-clause entry for table “charts”
: SELECT * FROM chart ORDER BY charts.id asc LIMIT 25 OFFSET 0
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
#{RAILS_ROOT}/app/views/ajax_scaffold/list.rhtml:1
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispat
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webric
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webric
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run’
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each’
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webric
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/comman
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/li
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/comman
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/li
script/server:3
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/li
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
#{RAILS_ROOT}/app/views/ajax_scaffold/list.rhtml:1
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plu
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispat
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webric
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webric
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run’
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each’
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start’
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webric
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/comman
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/li
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/comman
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/local/lib/site_ruby/1.8/rubygems/custom_requi
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/li
script/server:3
Request
Parameters: {"id"=>nil, “scaffold_id”=>"chart", “sort”=>nil, “sort_direction”=>"asc", “page”=>1}
Show session dump
chart:
:sort:
:page: 1
:sort_direction: asc
flash: !ruby/hash:ActionController::Flash::FlashHash {}
Response
Headers: {"cookie"=>[], “Cache-Control”=>"no-cache"}
Loading comments...