Hi, I've two models sharing the same table and have realized about a
possible bug or strange behavior in Rails 2.3:

- In both models I define the same table name (of course):
     def self.table_name() "address" end

- Then I create a helper for each model/controller, but the methods I
define on one of them are shared by both controllers!


Well, to avoid it I've created a VIEW, with same columns as the
original "address" table has.
Then I get an error when accessing to the new controller:



ActionView::TemplateError (undefined method `primary_key' for
2:Fixnum) on line #6 of
vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb:
3: dont_show_calculations ||= false
4: tr_class = cycle("", "even-record")
5: tr_class += " #{list_row_class(record)}" if respond_to?
:list_row_class
6: url_options = params_for(:action => :list, :id => record.id)
7: -%>
8:
9: <tr class="record <%= tr_class %>" id="<%= element_row_id(:action
=> :list, :id => record.id) %>">

    activerecord (2.3.4) lib/active_record/base.rb:2448:in `id'
    
vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb:6
    actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
    actionpack (2.3.4) lib/action_view/renderable.rb:34:in
`render_without_active_scaffold'
    actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
    actionpack (2.3.4) lib/action_view/renderable.rb:30:in
`render_without_active_scaffold'
    vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:in
`render'
    actionpack (2.3.4) lib/action_view/renderable_partial.rb:20:in
`render'
    actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
    activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
    /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
    activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
    actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
    actionpack (2.3.4) lib/action_view/renderable_partial.rb:19:in
`render'
    actionpack (2.3.4) lib/action_view/template.rb:199:in
`render_template'
    actionpack (2.3.4) lib/action_view/renderable_partial.rb:44:in
`render_partial'
    actionpack (2.3.4) lib/action_view/partials.rb:221:in
`render_partial_collection'
    actionpack (2.3.4) lib/action_view/partials.rb:216:in `map'
    actionpack (2.3.4) lib/action_view/partials.rb:216:in
`render_partial_collection'
    actionpack (2.3.4) lib/action_view/partials.rb:182:in
`render_partial'
    actionpack (2.3.4) lib/action_view/base.rb:262:in
`render_without_active_scaffold'
    vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:61:in
`render'
    vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb:16
    actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
    actionpack (2.3.4) lib/action_view/renderable.rb:34:in
`render_without_active_scaffold'
    actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
    actionpack (2.3.4) lib/action_view/renderable.rb:30:in
`render_without_active_scaffold'
    vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:in
`render'



Should active_scaffold work ok when using a MySQL VIEW?
Thanks.

-- 
Iñaki Baz Castillo
<[email protected]>

-- 
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