PiRSquared17 / activescaffold

Automatically exported from code.google.com/p/activescaffold
MIT License
0 stars 0 forks source link

config.ignore_columns does not works #298

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Follow Getting Started to "A Little More Flexibility Please"
2. First example
3.

What is the expected output? What do you see instead?
exception

What version (or revision) of the product are you using? 1.0

If this bug causes an exception, please paste at least the first 20 lines
below.

 NameError in UsersController#index

wrong constant name IgnoreColumns=

RAILS_ROOT: /home/bgv/rails/inspect/public/../config/..
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/config/core.rb:127:in
`const_defined?'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/config/core.rb:127:in
`method_missing'
#{RAILS_ROOT}/app/controllers/users_controller.rb:6
#{RAILS_ROOT}/app/controllers/users_controller.rb:4

#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/config/core.rb:127:in
`const_defined?'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/config/core.rb:127:in
`method_missing'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/configurable.rb:11:in
`instance_eval'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/configurable.rb:11:in
`configure'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/active_scaffold.rb:48:in
`active_scaffold'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:203:in
`load_without_new_constant_marking'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:203:in
`load_file'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:342:in
`new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:202:in
`load_file'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:94:in
`require_or_load_without_engine_additions'
#{RAILS_ROOT}/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.r
b:129:in
`require_or_load'
#{RAILS_ROOT}/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.r
b:101:in
`each'
#{RAILS_ROOT}/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.r
b:101:in
`require_or_load'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:248:in
`load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:452:in
`const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:464:in
`const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/inflector.rb:
250:in
`constantize'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/stri
ng/inflections.rb:148:in
`constantize'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1
284:in
`recognize'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:40:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:168:in
`process_request'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:143:in
`process_each_request!'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:109:in
`with_signal_handler'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:142:in
`process_each_request!'
/usr/lib/ruby/1.8/fcgi.rb:612:in `each_cgi'
/usr/lib/ruby/1.8/fcgi.rb:609:in `each'
/usr/lib/ruby/1.8/fcgi.rb:609:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:141:in
`process_each_request!'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:55:in `process!'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:25:in `process!'
/home/bgv/rails/inspect/public/dispatch.fcgi:24

#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/config/core.rb:127:in
`const_defined?'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/config/core.rb:127:in
`method_missing'
#{RAILS_ROOT}/app/controllers/users_controller.rb:6
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/configurable.rb:11:in
`instance_eval'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/configurable.rb:11:in
`configure'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/active_scaffold.rb:48:in
`active_scaffold'
#{RAILS_ROOT}/app/controllers/users_controller.rb:4
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:203:in
`load_without_new_constant_marking'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:203:in
`load_file'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:342:in
`new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:202:in
`load_file'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:94:in
`require_or_load_without_engine_additions'
#{RAILS_ROOT}/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.r
b:129:in
`require_or_load'
#{RAILS_ROOT}/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.r
b:101:in
`each'
#{RAILS_ROOT}/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.r
b:101:in
`require_or_load'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:248:in
`load_missing_constant'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:452:in
`const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.
rb:464:in
`const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/inflector.rb:
250:in
`constantize'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/stri
ng/inflections.rb:148:in
`constantize'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1
284:in
`recognize'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:40:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:168:in
`process_request'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:143:in
`process_each_request!'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:109:in
`with_signal_handler'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:142:in
`process_each_request!'
/usr/lib/ruby/1.8/fcgi.rb:612:in `each_cgi'
/usr/lib/ruby/1.8/fcgi.rb:609:in `each'
/usr/lib/ruby/1.8/fcgi.rb:609:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:141:in
`process_each_request!'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:55:in `process!'
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/fcgi_handler.rb:25:in `process!'
/home/bgv/rails/inspect/public/dispatch.fcgi:24

Request

Parameters: {"locale"=>"en"}

Show session dump

--- 
as:users: 
  :list: {}

:user: 3
:locale: en
:return_to: 
flash: !map:ActionController::Flash::FlashHash {}

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

Original issue reported on code.google.com by greg.but...@gmail.com on 11 May 2007 at 8:16

GoogleCodeExporter commented 9 years ago
Hi Greg,

Where are you using the config.ignore_columns setting? This is actually meant 
to be a
global setting, not local. I just tweaked the Getting Started doc to try and 
make
that a bit more obvious.

Original comment by cainl...@gmail.com on 11 May 2007 at 9:31

GoogleCodeExporter commented 9 years ago
class UsersController < ApplicationController
  # Be sure to include AuthenticationSystem in Application Controller instead
  layout 'admin'
  active_scaffold do |config| 
#   config.theme = :blue
#   config.ignore_columns = [:created_at, :updated_at]
    config.columns = [:login, :email, :roles]
  end
end

Not sure what do you mean global/local. Is there any description?
Thanks

Original comment by greg.but...@gmail.com on 13 May 2007 at 4:48

GoogleCodeExporter commented 9 years ago
Global settings are usually set in the ApplicationController, and apply to all
scaffolds in the entire application.

The ignore_columns setting is intended to remove some special columns that you 
may
have in your database schema. For example, if you consistently use "inserted_at"
instead of "created_at" you may want to put that in the ignore_columns array.

If you want to ignore columns on a specific controller, please use the
config.#{action}.columns.exclude method instead. For example,
"config.list.columns.exclude :created_at, :updated_at".

Original comment by cainl...@gmail.com on 13 May 2007 at 6:16