モデルのローカライズに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:in
visit' arel (2.0.6) lib/arel/visitors/to_sql.rb:109:invisit_Arel_Nodes_Grouping' arel (2.0.6) lib/arel/visitors/visitor.rb:15:in
visit' 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:inmap' arel (2.0.6) lib/arel/visitors/to_sql.rb:77:in
visit_Arel_Nodes_SelectStatement' arel (2.0.6) lib/arel/visitors/sqlite.rb:7:invisit_Arel_Nodes_SelectStatement' arel (2.0.6) lib/arel/visitors/visitor.rb:15:in
visit' arel (2.0.6) lib/arel/visitors/visitor.rb:5: inaccept' arel (2.0.6) lib/arel/visitors/to_sql.rb:19:in
block in accept 'activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:110:inwith_connection' arel (2.0.6) lib/arel/visitors/to_sql.rb:17:in
accept' arel (2.0.6) lib/arel/tree_manager.rb:19:into_sql' activerecord (3.0.3) lib/active_record/relation.rb:318:in
to_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:in
perform_calculation' activerecord (3.0.3) lib/active_record/relation/calculations.rb:152:incalculate' activerecord (3.0.3) lib/active_record/relation/calculations.rb:84:in
maximum' activerecord (3.0.3) lib/active_record/base.rb:442:inmaximum' activerecord (3.0.3) lib/active_record/associations/association_collection.rb:443:in
block in method_missing' activerecord (3.0.3) lib/active_record/base.rb:1121:inwith_scope' activerecord (3.0.3) lib/active_record/associations/association_proxy.rb:203:in
with_scope' activerecord (3.0.3) lib/active_record/associations/association_collection.rb:439:inmethod_missing' /home/florian/.rvm/gems/ruby-1.9.2-p0/bundler/gems/vestal_versions-6273df533f85/lib/vestal_versions/reversion.rb:66:in
last_version' /home/florian/.rvm/gems/ruby-1.9.2- p0/bundler/gems/vestal_versions-6273df533f85/lib/vestal_versions/reversion.rb:10:inversion' 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:inblock in render' activesupport (3.0.3) lib/active_support/notifications.rb:54:in
instrument' 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:inblock in instrument' activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in
instrument' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument' 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:in
in_render_template' アクションパック (3.0.3) lib/abstract_controller/rendering.rb:108:inrender_to_body' actionpack (3.0.3) lib/action_controller/metal/renderers.rb:47:in
render_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:in
render_to_string' actionpack (3.0.3) lib/abstract_controller/rendering.rb:92:in renderrender' 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:in
ms' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:40:inblock in render' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:78:in
cleanup_view_runtime' activerecord (3.0.3) lib/active_record/railties/controller_runtime.rb:15:incleanup_view_runtime' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:39:in
render' 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:in
send_action 内の actionpack (3.0.3) lib/abstract_controller/base.rb:151:inprocess_action' actionpack (3.0.3) lib/action_controller/metal/rendering.rb:11:in
process_action 内の actionpack (3.0.3) lib/abstract_controller/callbacks.rb:18: inblock in process_action' activesupport (3.0.3) lib/active_support/callbacks.rb:450:in
run _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:in
run_callbacks' actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17: inprocess_action' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in
block 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:in
instrument' activesupport (3.0.3) lib/active_support/notifications.rb:52:ininstrument' actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:in
process_action' actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:inprocess_action' actionpack (3.0.3) lib/abstract_controller/base.rb:120:in
process' 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:in
optimized_each中' ラックマウント (0.6.13) lib/rack/mount/code_generation.rb:92:inrecognize' rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in
call' アクションパック (3.0.3) lib/action_dispatch/routing/route_set.rb:492:incall' warden (1.0.2) lib/warden/manager.rb:35:in
block in call' warden (1.0.2) lib/warden/manager.rb:34: incatch' warden (1.0.2) lib/warden/manager.rb:34:in
call' actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17: incall' actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in
call' rack (1.2.1) lib/rack/methodoverride.rb:24: incall' actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in
call' actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182: incall' actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in
call' actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb: 295:incall' /home/florian/.rvm/gems/ruby-1.9.2-p0/bundler/gems/rails-ckeditor-49cb3b60b3ed/lib/ckeditor/middleware.rb:15:in
call' activerecord (3.0.3) lib/active_record/query_cache.rb:32:inblock in call' activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in
cache' activerecord (3.0.3) lib/active_record/query_cache.rb:12:incache' activerecord (3.0.3) lib/active_record/query_cache.rb:31:in
call' activerecord (3.0.3) lib /active_record/connection_adapters/abstract/connection_pool.rb:353call' 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:in
call' rack (1.2.1) lib/rack/sendfile.rb :107:インチcall' actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in
call' actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:incall' railties (3.0.3) lib/rails/rack/logger.rb:13:in
call' ラック (1.2.1) lib/rack/runtime.rb:17:incall' activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in
call' ラック (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: incall' railties (3.0.3) lib/rails/application.rb:77:in
method_missing' railties (3.0.3) lib/rails/rack/log_tailer.rb:14:incall' rack (1.2.1) lib/rack/content_length.rb:13:in
call' ラック (1.2.1) lib/rack/handler/webrick.rb:52:inservice' /home/florian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:111:in
service' /home/florian/.rvm/rubies /ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/httpserver.rb:70:inrun' /home/florian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/webrick/server.rb:183:in
block in start_thread'