I\'ve been trying hard to solve this problem but i really don\'t know what is happening. I have this small piece of code :
DiscoveredLocation.find_by_user_id(use
The DiscoveredLocation model is attempting to define a nested has-many through association:
DiscoveredLocation has_many :monsters, :through => :boss_location
DiscoveredLocation has_many :boss_kills, :through => :monsters
I don't believe ActiveRecord can do this out of the box. There is a nested_has_many_through plugin which claims to support this -- I have no idea if it would work in this case.
More discussion can be found here and here
I could be wrong, however to help you out, try DiscoveredLocation.find_by_user_id(user.id, :include => [:boss_kill])
Lastly, are you sure you are passing a variable called user into the controller? maybe current_user, if you are using a popular auth gem?
You need to include the intermediate tables as well, otherwise there's no way to map boss_kills to DiscoveredLocations:
DiscoveredLocation.find_by_user_id(user.id, :include => [:monsters, :boss_locations,:boss_kills])
Also, check your development log to see the query that gets generated. If possible, post it here so we can determine whether it's missing one of the intermediate tables.