
nil errors after upgrading to Rails 2.2
Reported by Prometheus | November 27th, 2008 @ 01:23 PM
I recently upgraded to Rails 2.2.2. I had Searchgasm running just perfectly, and started getting this error in my controller.
I tried upgrading to the latest version of searchlogic, to no avail.
NoMethodError in MattersController#index
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.klass
vendor/rails/activerecord/lib/active_record/reflection.rb:244:in
source_reflection'
vendor/rails/activerecord/lib/active_record/reflection.rb:244:in
collect'
vendor/rails/activerecord/lib/active_record/reflection.rb:244:in
source_reflection'
vendor/rails/activerecord/lib/active_record/reflection.rb:303:in
derive_class_name'
vendor/rails/activerecord/lib/active_record/reflection.rb:107:in
class_name'
vendor/plugins/searchlogic/lib/searchlogic/conditions/base.rb:269:in
add_associations!'
vendor/plugins/searchlogic/lib/searchlogic/conditions/base.rb:263:in
each'
vendor/plugins/searchlogic/lib/searchlogic/conditions/base.rb:263:in
add_associations!'
vendor/plugins/searchlogic/lib/searchlogic/conditions/base.rb:151:in
initialize'
vendor/plugins/searchlogic/lib/searchlogic/search/conditions.rb:17:in
new'
vendor/plugins/searchlogic/lib/searchlogic/search/conditions.rb:17:in
initialize'
vendor/plugins/searchlogic/lib/searchlogic/active_record/base.rb:140:in
new'
vendor/plugins/searchlogic/lib/searchlogic/active_record/base.rb:140:in
searchlogic_search'
vendor/plugins/searchlogic/lib/searchlogic/active_record/base.rb:65:in
new_search'
vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:370:in
send'
vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:370:in
method_missing'
vendor/rails/activerecord/lib/active_record/base.rb:2003:in
with_scope_without_searchlogic'
vendor/plugins/searchlogic/lib/searchlogic/active_record/base.rb:47:in
with_scope'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:202:in
send'
vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:202:in
with_scope'
vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:366:in
method_missing'
app/controllers/matters_controller.rb:9:in
index'
-e:2:in `load' -e:2
Comments and changes to this ticket
-
Ben Johnson November 27th, 2008 @ 01:42 PM
- State changed from new to open
Its now called searchlogic, are you using the latest searchlogic gem?
-
Ben Johnson November 30th, 2008 @ 03:25 PM
Hi Jack,
I updated the example to rails 2.2.2 and all seems to be working fine. Can you reproduce the problem with the example?
-
Ben Johnson December 3rd, 2008 @ 03:14 PM
- State changed from open to resolved
-
Ben Johnson January 8th, 2009 @ 02:27 PM
This is strange, I can't fix the problem if I can't reproduce it. Based on the backtrace it has something do with your associations. Go to magic_methods.rb line 60 and you will see where the problem is. I am not sure what kind of relationship is causing that.
Lastly, my website is propagating, I had to make some DNS changes, everything should be working shortly, it is working for me.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Provides common named scopes and object based searching.