What I am doing is:
class Site < ActuveRecord::Base
has_many :site_relationships, :dependent => :destroy
has_many :profiles, :through => :site_relationships
after_save :reindex_profiles
def reindex_profiles
Sunspot.index!(self.profiles)
end
end
But nothing happen, profile doesn't appear in results, but if I will disable the queue all works as expected.
Also all works if I will run it in this way:
site = Site.last
site.reindex_profiles
What I am doing is:
But nothing happen, profile doesn't appear in results, but if I will disable the queue all works as expected.
Also all works if I will run it in this way: