-2

これによりuser.recipes.count、「受信者が指定されていません」という例外がスローされます。レシピの関連付けに関するすべての操作がそれを行います (最初、最後、合計など)。

gem の更新は行われませんでした。

ここにコールスタック:

activerecord (4.0.3) lib/active_record/relation/spawn_methods.rb:41:in `instance_exec'
activerecord (4.0.3) lib/active_record/relation/spawn_methods.rb:41:in `merge!'
activerecord (4.0.3) lib/active_record/relation/spawn_methods.rb:33:in `merge'
activerecord (4.0.3) lib/active_record/scoping/default.rb:115:in `block (2 levels) in build_default_scope'
activerecord (4.0.3) lib/active_record/scoping/default.rb:111:in `each'
activerecord (4.0.3) lib/active_record/scoping/default.rb:111:in `inject'
activerecord (4.0.3) lib/active_record/scoping/default.rb:111:in `block in build_default_scope'
activerecord (4.0.3) lib/active_record/scoping/default.rb:138:in `evaluate_default_scope'
activerecord (4.0.3) lib/active_record/scoping/default.rb:110:in `build_default_scope'
activerecord (4.0.3) lib/active_record/relation.rb:554:in `with_default_scope'
activerecord (4.0.3) lib/active_record/relation/finder_methods.rb:324:in `find_first'
activerecord (4.0.3) lib/active_record/relation/finder_methods.rb:90:in `first'
activerecord-deprecated_finders (1.0.3) lib/active_record/deprecated_finders/relation.rb:129:in `first'
activerecord (4.0.3) lib/active_record/associations/collection_association.rb:602:in `first_or_last'
activerecord (4.0.3) lib/active_record/associations/collection_association.rb:103:in `first'
activerecord (4.0.3) lib/active_record/associations/collection_proxy.rb:171:in `first'
app/views/users/_index.html.erb:26:in `block in _app_views_users__index_html_erb__4515165452254072945_70190748446560'
activerecord (4.0.3) lib/active_record/relation/delegation.rb:13:in `each'
activerecord (4.0.3) lib/active_record/relation/delegation.rb:13:in `each'
app/views/users/_index.html.erb:20:in `_app_views_users__index_html_erb__4515165452254072945_70190748446560'
(standard part following omitted)
4

1 に答える 1

-1

ログを見てください。非推奨の警告があります:

DEPRECATION WARNING: Calling #default_scope without a block is deprecated. 
For example instead of `default_scope where(color: 'red')`, please use `default_scope { where(color: 'red') }`. 
(Alternatively you can just redefine self.default_scope.). (called from ...)

それを修正すると、例外が修正されます。

于 2014-08-28T07:05:48.497 に答える