Rails 3.0.3: использование vestal_versions с globalize3

Я пытаюсь добавить vestal_versions (1.2.2) на сайт, который использует globalize3 (0.0.11) для локализации моделей.

Когда я пытаюсь отобразить версию модели следующим образом:

 <% if can?(:edit, Page) then %>
  <div class="edit_link"><%= link_to image_tag("appicons/edit.png", :alt => t(:edit)), edit_page_path(@page) %><br />
  Version <%= @page.version %></div>
<% end %>

Я получил:

Ошибка типа в Viewer#show

Показывает /home/florian/spzwww3/app/views/viewer/show.html.erb, где поднята строка #50:

Не могу посетить Условие

Линия № 50 - это та, @page.version

Отображение версии в консоли работает нормально:

ruby-1.9.2-p0 > p = Page.find(:last)
ruby-1.9.2-p0 > p.version
 => 1 

Любые идеи, что означает условие "Не удается посетить условие"?

Я никогда не видел это сообщение раньше, и Google возвращает только один несвязанный результат для этой фразы.

Заранее спасибо за любые советы.


Вот полный след:

arel (2.0.6) lib / arel / users / visitor.rb: 21: в rescue in visit' arel (2.0.6) lib/arel/visitors/visitor.rb:15:inпосетите ' arel (2.0.6) lib/arel/ посетители /to_sql.rb:109: в visit_Arel_Nodes_Grouping' arel (2.0.6) lib/arel/visitors/visitor.rb:15:inпосетите ' arel (2.0.6) lib/arel/ посетители /to_sql.rb:89: в block in visit_Arel_Nodes_SelectCore' arel (2.0.6) lib/arel/visitors/to_sql.rb:89:inmap' arel (2.0.6) lib/arel/ посетители /to_sql.rb:89: в visit_Arel_Nodes_SelectCore' arel (2.0.6) lib/arel/visitors/to_sql.rb:77:inблок в файле visit_Arel_Nodes_SelectStatement' arel (2.0.6) lib/arel/ посетители /to_sql.rb:77: в map' arel (2.0.6) lib/arel/visitors/to_sql.rb:77:invisit_Arel_Nodes_SelectStatement' arel (2.0.6) lib/arel/ посетителей /sqlite.rb:7: в visit_Arel_Nodes_SelectStatement' arel (2.0.6) lib/arel/visitors/visitor.rb:15:inпосетите ' arel (2.0.6) lib/arel/ users / visitor.rb: 5: in accept' arel (2.0.6) lib/arel/visitors/to_sql.rb:19:inblock in accept 'activerecord (3.0.3) lib / active_record / connection_adapters / abstract / connection_pool.rb: 110: в with_connection' arel (2.0.6) lib/arel/visitors/to_sql.rb:17:inпринять ' arel (2.0.6) lib/arel/tree_manager.rb:19: в to_sql' activerecord (3.0.3) lib/active_record/relation.rb:318:into_sql' activerecord (3.0.3) lib/active_record/ratio / computing.rb:207: в execute_simple_calculation' activerecord (3.0.3) lib/active_record/relation/calculations.rb:182:inexecute_calculation 'activerecord (3.0.3) lib / active_record / ratio / computing.rb: 152: в calculate' activerecord (3.0.3) lib/active_record/relation/calculations.rb:84:inмаксимум ' activerecord (3.0.3) lib/active_record/base.rb:442: в maximum' activerecord (3.0.3) lib/active_record/associations/association_collection.rb:443:inблок в method_missing' activerecord (3.0.3) lib/active_record/base.rb:1121: в with_scope' activerecord (3.0.3) lib/active_record/associations/association_proxy.rb:203:inwith_scope' activerecord (3.0.3) lib/active_record/association /association_collection.rb:439: в method_missing' /home/florian/.rvm/gems/ruby-1.9.2-p0/bundler/gems/vestal_versions-6273df533f85/lib/vestal_versions/reversion.rb:66:inlast_version '/home/florian/.rvm/gems/ruby-1.9.2-p0/bundler/gems/vestal_versions-6273df533f85/lib/vestal_versions/reversion.rb:10:in version' app/views/viewer/show.html.erb:50:in_app_views_viewer_show_html_erb___3169340765490706064_17989400_4488323425482422564 'actionpack (3.0.3) lib / action_view / template.rb: 135: в block in render' activesupport (3.0.3) lib/active_support/notifications.rb:54:inИнструментарий ' actionpack (3.0.3) lib/action_view/template.rb:127:in render' actionpack (3.0.3) lib/action_view/render/rendering.rb:59:inблок в _render_template' activesupport (3.0.3) lib/active_support/notifications.rb:52:in block in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:inИнструмент 'activesupport (3.0.3) lib / active_support / notifications.rb: 52: in instrument' actionpack (3.0.3) lib/action_view/render/rendering.rb:56:in_render_template 'actionpack (3.0.3) lib / action_view / render /dering.rb: 26: in render' actionpack (3.0.3) lib/abstract_controller/rendering.rb:114:in_render_template 'actionpack (3.0.3) lib / abstract_controller / render.rb: 108: in render_to_body' actionpack (3.0.3) lib/action_controller/metal/renderers.rb:47:inrender_to_body 'actionpack (3.0.3) lib / action_controller / metal / compatibility.rb: 55: in render_to_body' actionpack (3.0.3) lib/abstract_controller/rendering.rb:101:inrender_to_string 'actionpack (3.0.3) lib / abstract_controller / render.rb: 92: in render' actionpack (3.0.3) lib/action_controller/metal/rendering.rb:17:inrender 'actionpack (3.0.3) lib / action_controller / metal / instrumentation.rb: 40: in block (2 levels) in render' activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:inблок в ms '/home/florian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/benchmark.rb:309:in realtime' activesupport (3.0.3) lib/active_support/core_ext/benchmark.rb:5:inms 'actionpack (3.0.3) lib / action_controller / metal / instrumentation.rb: 40: in block in render' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:78:incleanup_view_runtime 'activerecord (3.0.3) lib / active_record / railties / controller_runtime.rb: 15: in cleanup_view_runtime' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:39:inrender 'actionpack (3.0.3) lib / action_controller / metal / implicit_render.rb: 10: in default_render' actionpack (3.0.3) lib/action_controller/metal/implicit_render.rb:5:insend_action 'actionpack (3.0.3) lib / abstract_controller / base.rb: 151: in process_action' actionpack (3.0.3) lib/action_controller/metal/rendering.rb:11:inaction_action' actionpack (3.0.3) lib/abstract_controller/callbacks.rb:18:in block in process_action' activesupport (3.0.3) lib/active_support/callbacks.rb:450:inзапустите_2100642650872989332__process_action_2749632540183314212_callbacks 'activesupport (3.0.3) lib / active_support / callbacks.rb: 409: в _run_process_action_callbacks' activesupport (3.0.3) lib/active_support/callbacks.rb:93:inПакет действий run_callbacks (3.0.3) lib/abstract_controller/callbacks.rb:17:in process_action' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:inблок в process_action' activesupport (3.0.3) lib/active_support/notifications.rb:52:in block in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:inИнструмент 'activesupport (3.0.3) lib / active_support / notifications.rb: 52: in instrument' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:inaction_action' actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:in process_action' actionpack (3.0.3) lib/abstract_controller/base.rb:120:inпроцесс 'actionpack (3.0.3) lib / abstract_controller / render.rb: 40: in process' actionpack (3.0.3) lib/action_controller/metal.rb:138:indispatch 'actionpack (3.0.3) lib / action_controller / metal / rack_delegation.rb: 14: in dispatch' actionpack (3.0.3) lib/action_controller/metal.rb:178:inблок в действии 'actionpack (3.0.3) lib / action_dispatch / routing / route_set.rb: 62: in call' actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:indispatch 'actionpack (3.0.3) lib / action_dispatch / routing / route_set.rb: 27: in call' rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:inблок в call 'монтируется в стойку (0.6.13) lib / rack / mount / code_generation.rb: 93: in block in recognize' rack-mount (0.6.13) lib/rack/mount/code_generation.rb:264:inoptimized_each 'стойку (0.6.13) lib/rack/mount/code_generation.rb:92:in recognize' rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:inвызов ' actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492: в call' warden (1.0.2) lib/warden/manager.rb:35:inблок в call' warden (1.0.2) lib/warden/manager.rb:34:in catch' warden (1.0.2) lib/warden/manager.rb:34:inвызов 'actionpack (3.0.3) lib / action_dispatch / middleware / best_standards_support.rb: 17: in call' actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:incall 'rack (1.2.1) lib / rack / metadoverride.rb:24:in call' actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:inвызов 'actionpack (3.0.3) lib / action_dispatch / middleware / flash.rb: 182: in call' actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:incall 'actionpack (3.0.3) lib / action_dispatch / middleware / cookies.rb: 295: в call' /home/florian/.rvm/gems/ruby-1.9.2-p0/bundler/gems/rails-ckeditor-49cb3b60b3ed/lib/ckeditor/middleware.rb:15:incall 'activerecord (3.0.3) lib / active_record / query_cache.rb: 32: in block in call' activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:incache 'activerecord (3.0.3) lib / active_record / query_cache.rb: 12: in cache' activerecord (3.0.3) lib/active_record/query_cache.rb:31:incall 'activerecord (3.0.3) lib / active_record / connection_adapters / abstract / connection_pool.rb: 353: в call' actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:inблок в вызове ' activesupport (3.0.3) lib/active_support/callbacks.rb:415: в _run_call_callbacks' actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:incall' rack (1.2.1) lib/rack/sendfile.rb:107:in call' actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:inвызов 'actionpack (3.0.3) lib / action_dispatch / middleware / show_exceptions.rb: 46: in call' railties (3.0.3) lib/rails/rack/logger.rb:13:incall 'rack (1.2.1) lib / rack / runtime.rb: 17: in call' activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:incall 'rack (1.2.1) lib / rack / lock.rb: 11: in block in call' <internal:prelude>:10:inсинхронизировать 'rack (1.2.1) lib / rack / lock.rb: 11: in call' actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:incall 'railties (3.0.3) lib / rails / application.rb: 168: in call' railties (3.0.3) lib/rails/application.rb:77:inmethod_missing 'railties (3.0.3) lib / rails / rack / log_tailer.rb: 14: в call' rack (1.2.1) lib/rack/content_length.rb:13:incall' rack (1.2.1) lib/rack/handler/webrick.rb:52:in service' /home/florian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:111:inслужба ' /home/florian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' /home/florian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/server.rb:183:inблок в start_thread '

0 ответов

Другие вопросы по тегам