PiRSquared17 / activescaffold

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

Recent Commit breaks Polymorpic Relationships #707

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It looks like the following commit breaks activescaffold's ability to
handle polymorphic relationships.

http://github.com/activescaffold/active_scaffold/commit/6a34dcb5818d6f6d82138bb1
2ab24b4ab8df5284

-------------simple example---------------------

class User < ActiveRecord::Base
  has_one :address, :as => :addressable
end

class Address < ActiveRecord::Base
  belongs_to :addressable, :polymorphic => true
end

class AddressesController < ApplicationController
  active_scaffold :address  
end

----------------------------------------------

You will find yourself greeted with the following
stack trace if you try to visit localhost:3000/addresses

----------------Stack Trace------------------

/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.
rb:105:in
`const_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2199:in
`compute_type'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kern
el/reporting.rb:11:in
`silence_warnings'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2195:in
`compute_type'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:1
56:in
`send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:1
56:in
`klass'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/col
umn.rb:296:in
`initialize_search_sql'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/col
umn.rb:153:in
`search_sql'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/col
umn.rb:157:in
`searchable?'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb:34
:in
`columns'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.
rb:380:in
`collect'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/col
umns.rb:62:in
`each'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/col
umns.rb:62:in
`each'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb:34
:in
`collect'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb:34
:in
`columns'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:139:
in
`_load_action_columns'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/act
ions.rb:20:in
`each'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/act
ions.rb:20:in
`each'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:136:
in
`_load_action_columns'
[testapp]/vendor/plugins/active_scaffold/lib/active_scaffold.rb:63:in
`active_scaffold'
[testapp]/app/controllers/addresses_controller.rb:2

Original issue reported on code.google.com by Rio...@gmail.com on 5 Oct 2009 at 2:24

GoogleCodeExporter commented 9 years ago
Fixed in 00da9a9

Original comment by sergio.c...@gmail.com on 6 Oct 2009 at 8:26