Skip to content
Browse files

removes ! from flatten, was causing this procedure to return nil inst…

…ead of [] - which caused a nil deref downstream.
  • Loading branch information...
1 parent 9bc850e commit 16762cdd60c3ae410c44cb257d4cb39773426998 @bwlang committed Apr 11, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/bullet/registry/association.rb
2 lib/bullet/registry/association.rb
@@ -9,7 +9,7 @@ def merge( base, associations )
def similarly_associated( base, associations ) do |key, value|
key.include?( base ) and value == associations
- end.collect( &:first ).flatten!
+ end.collect( &:first ).flatten

1 comment on commit 16762cd

bwlang commented on 16762cd Apr 11, 2011

fixes this problem
Status: 500 Internal Server Error
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.collect
/Library/Ruby/Gems/1.8/gems/bullet-2.0.1/lib/bullet/detector/unused_eager_association.rb:26:in call_object_association'
/Library/Ruby/Gems/1.8/gems/bullet-2.0.1/lib/bullet/detector/unused_eager_association.rb:12:in `check_unused_preload_associations'

Please sign in to comment.
Something went wrong with that request. Please try again.