3

モデルのローカライズにglobalize3 (0.0.11) を使用するサイトに、 vestal_versions (1.2.2)を追加しようとしています。

次のようにモデルのバージョンを表示しようとすると:

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

私は得る:

ビューアの TypeError#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 はそのフレーズに対して無関係な結果を 1 つだけ返します。

ヒントをお寄せいただきありがとうございます。


完全なトレースは次のとおりです。

arel (2.0.6) lib/arel/visitors/visitor.rb:21:in rescue in visit' arel (2.0.6) lib/arel/visitors/visitor.rb:15:invisit' arel (2.0.6) lib/arel/visitors/to_sql.rb:109:in visit_Arel_Nodes_Grouping' arel (2.0.6) lib/arel/visitors/visitor.rb:15:invisit' arel (2.0.6) lib/ arel/visitors/to_sql.rb:89:block in visit_Arel_Nodes_SelectCore' arel (2.0.6) lib/arel/visitors/to_sql.rb:89:inマップ内' arel (2.0.6) lib/arel/visitors/to_sql.rb:89:visit_Arel_Nodes_SelectStatement 内visit_Arel_Nodes_SelectCore' arel (2.0.6) lib/arel/visitors/to_sql.rb:77:inブロック内' arel (2.0.6) lib/arel/visitors/to_sql. rb:77:in map' arel (2.0.6) lib/arel/visitors/to_sql.rb:77:invisit_Arel_Nodes_SelectStatement' arel (2.0.6) lib/arel/visitors/sqlite.rb:7:in visit_Arel_Nodes_SelectStatement' arel (2.0.6) lib/arel/visitors/visitor.rb:15:invisit' arel (2.0.6) lib/arel/visitors/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:in with_connection' arel (2.0.6) lib/arel/visitors/to_sql.rb:17:inaccept' arel (2.0.6) lib/arel/tree_manager.rb:19:in to_sql' activerecord (3.0.3) lib/active_record/relation.rb:318:into_sql' activerecord (3.0.3) lib /active_record/relation/calculations.rb:207:inexecute_simple_calculation' activerecord (3.0.3) lib/active_record/relation/calculations.rb:182:inperform_calculation' activerecord (3.0.3) lib/active_record/relation/calculations.rb:152:in calculate' activerecord (3.0.3) lib/active_record/relation/calculations.rb:84:inmaximum' activerecord (3.0.3) lib/active_record/base.rb:442:in maximum' activerecord (3.0.3) lib/active_record/associations/association_collection.rb:443:inblock in method_missing' activerecord (3.0.3) lib/active_record/base.rb:1121:in with_scope' activerecord (3.0.3) lib/active_record/associations/association_proxy.rb:203:inwith_scope' activerecord (3.0.3) lib/active_record/associations/association_collection.rb:439:in 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:in block in render' activesupport (3.0.3) lib/active_support/notifications.rb:54:ininstrument' actionpack (3.0.3) lib/ action_view/template.rb:127:inrender' actionpack (3.0.3) lib/action_view/render/rendering.rb:59:inブロック 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:ininstrument' 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/rendering.rb:26: render' actionpack (3.0.3) lib/abstract_controller/rendering.rb:114:inin_render_template' アクションパック (3.0.3) lib/abstract_controller/rendering.rb:108:in render_to_body' actionpack (3.0.3) lib/action_controller/metal/renderers.rb:47:inrender_to_body' アクションパック (3.0.3) lib/action_controller/metal/compatibility.rb:55: render_to_body' actionpack (3.0.3) lib/abstract_controller/rendering.rb:101:inrender_to_string' actionpack (3.0.3) lib/abstract_controller/rendering.rb:92:in render render' actionpack (3.0.3) lib/action_controller/metal/rendering.rb:17:in' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40: inblock (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:inrealtime' 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: 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:inprocess_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:inrun _2100642650872989332__process_action_ 2749632540183314212 _callbacks' activesupport (3.0.3) lib/active_support/callbacks.rb:409: in _run_process_action_callbacks' activesupport (3.0.3) lib/active_support/callbacks.rb:93:inrun_callbacks' actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17: in process_action' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:inblock in process_action' activesupport ( 3.0.3) 3) lib/active_support/notifications.rb:52:でblock in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:ininstrument' activesupport (3.0.3) lib/active_support/notifications.rb:52:in instrument' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:inprocess_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:inprocess' actionpack (3.0.3) lib/ abstract_controller/rendering.rb:40:process' actionpack (3.0.3) lib/action_controller/metal.rb:138:inディスパッチ内のアクションパック (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:アクション内dispatch' actionpack (3.0.3) lib/action_controller/metal.rb:178:inのブロック内アクションパック (3.0.3) lib/action_dispatch/routing/route_set.rb: 62:call' actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:inディスパッチ中' アクションパック (3.0.3) lib/action_dispatch/routing/route_set.rb:27:call' rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in呼び出し中' ラックマウント (0.6.13) lib/rack/mount/code_generation.rb:93: 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:incall' アクションパック (3.0.3) lib/action_dispatch/routing/route_set.rb:492:incall' warden (1.0.2) lib/warden/manager.rb:35:inblock in call' warden (1.0.2) lib/warden/manager.rb:34: in catch' warden (1.0.2) lib/warden/manager.rb:34:incall' 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/methodoverride.rb:24: in call' actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:incall' 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:in 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: in call' activesupport (3.0.3) lib/active_support/callbacks.rb:415: in _run_call_callbacks' actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:incall' rack (1.2.1) lib/rack/sendfile.rb :107:インチcall' actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:incall' 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' ラック (1.2.1) lib/rack/runtime.rb:17:in call' activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:incall' ラック (1.2.1) lib/ Rack/lock.rb:11:block in call' <internal:prelude>:10:in同期中' ラック (1.2.1) lib/rack/lock.rb:11:call' actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in呼び出し中' 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:in call' rack (1.2.1) lib/rack/content_length.rb:13:incall' ラック (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:inservice' /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:inblock in start_thread'

4

0 に答える 0