Hello there. I wonder if you could help with with an error I'm getting.
I have a 'has_many through' association in my application. I have a Batch model which has the following association:
has_many :items, :through => :associations, :source => :item
The Item model has the following association:
has_many :batches, :through => :associations, :source => :batch
I then have an Association model with the following:
belongs_to :item belongs_to :batch
The problem I have is that I am experiencing a intermitted error when making use of the association. Sometimes the association works (i.e. when looking up batch.items) and then other times the _same_ request fails with the error:
ActiveRecord::HasManyThroughSourceAssociationNotFoundError (Could not find the source association(s) :batch in model Remote::Association. Try 'has_many :batches, :through => :associations, :source => <name>'. Is it one of :item or :project?):
Basically the problem here is that sometimes the view that makes use of the association works and sometimes it doesn't. All I have to do is keep hitting refresh on the browser and eventually the batch items are returned.
Any ideas as to why I might be experiencing this error?
Thanks
arfon