I am stuck in this error for quite sometime now and have hit a dead end.
I get this totally unhelpful error
can't dup NilClass
This is the situation.
I have one class which is in a relationship with another. Say
class Parent
end
class Child < Parent
unloadable
:has_many :parents, :foreign_key => "child"
end
The error does not occur the first time it is accessed. It occurs the second time the child is accessed.
What is exactly causing this error and is there a solution?
I referred the following link but it doesn't help
Update
I found this
But it suggests the same again. But i do have a module in my lib. It Has nothing to do with the model though.