I'm guessing that AS initiation should check the model columns when it
attaches to the model, and fail gracefully at that point. I thought of
adding a safe_active_scafold wrapper around the:

active_scaffold :<model> do | config |
...
end

as:

  def self.safe_active_scaffold(*args, &blk)
    begin
      active_scaffold args, blk
        rescue
         print args[0], " -> skipping active scaffold!!! ", $!, "\n"
        end
    end
  end

but have not mastered meta programming yet.....and I'm not sure how to
get the block to evaluate.

Any pointers....much appreciated.

On Apr 20, 10:15 pm, simonS <[email protected]> wrote:
> Hi
>
> An odd one....I've sen this before and it went away, and now its back
> again, and may be more a Rails issue, but each time has manifested
> itself it get picked up in active scaffold code, so I'm starting
> here....
>
> Googling arround did not bring any specific answers.
>
> To solve it last time I "removed" the controllers from the project
> before the migration; but this is not going to work going forwards.
>
> Essentially I have code in production, and have developed more models,
> migrations and controllers. I'm now trying to migrate those migrations
> to production and I get the error trace below....
>
> The models in question do have an id column, but the table as yet does
> not exist in the database...so its a chicken and egg issue....does
> anyone else get this ? does it have something to do with version of
> schema.rb ?
>
> C:\SVN Code\Turner\trunk\webapp>rake db:migrate RAILS_ENV=production --
> trace
> (in C:/SVN Code/Turner/trunk/webapp)
> ** Invoke db:migrate (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> rake aborted!
> Could not find column id
> C:/SVN Code/Turner/trunk/webapp/vendor/plugins/active_scaffold/lib/
> active_scaffold/data_st
> ructures/sorting.rb:16:in `add'
> C:/SVN Code/Turner/trunk/webapp/vendor/plugins/active_scaffold/lib/
> active_scaffold/config/
> list.rb:14:in `initialize'
> C:/SVN Code/Turner/trunk/webapp/vendor/plugins/active_scaffold/lib/
> active_scaffold/config/
> core.rb:140:in `new'
> C:/SVN Code/Turner/trunk/webapp/vendor/plugins/active_scaffold/lib/
> active_scaffold/config/
> core.rb:140:in `method_missing'
> C:/SVN Code/Turner/trunk/webapp/app/controllers/
> business_activity_in_outs_controller.rb:4
> C:/SVN Code/Turner/trunk/webapp/vendor/plugins/active_scaffold/lib/
> active_scaffold/configu
> rable.rb:11:in `instance_eval'
> C:/SVN Code/Turner/trunk/webapp/vendor/plugins/active_scaffold/lib/
> active_scaffold/configu
> rable.rb:11:in `configure'
> C:/SVN Code/Turner/trunk/webapp/vendor/plugins/active_scaffold/lib/
> active_scaffold.rb:57:i
> n `active_scaffold'
> C:/SVN Code/Turner/trunk/webapp/app/controllers/
> business_activity_in_outs_controller.rb:2
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `polyglot_original_require
> '
> c:/ruby/lib/ruby/gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in
> `require'
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependencies.rb:155:
> in `require'
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependencies.rb:262:
> in `require_or_load'
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependencies.rb:221:
> in `depend_on'
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependencies.rb:133:
> in `require_dependency'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:368:in
> `load_application_cla
> sses'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:367:in
> `each'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:367:in
> `load_application_cla
> sses'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:365:in
> `each'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:365:in
> `load_application_cla
> sses'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:185:in
> `process'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in
> `send'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in
> `run'
> C:/SVN Code/Turner/trunk/webapp/config/environment.rb:16
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependencies.rb:153:
> in `require'
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependencies.rb:521:
> in `new_constants_in'
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependencies.rb:153:
> in `require'
> c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/misc.rake:3
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in
> `invoke_with_call_chain'
> c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
> `invoke_with_call_chain'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in
> `invoke_prerequisites'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in
> `invoke_prerequisites'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in
> `invoke_with_call_chain'
> c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
> `invoke_with_call_chain'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in
> `invoke_task'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in
> `top_level'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in
> `top_level'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
> `standard_exception_handling
> '
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in
> `top_level'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
> `standard_exception_handling
> '
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'
> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31
> c:/ruby/bin/rake:16:in `load'
> c:/ruby/bin/rake:16
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to