Skip to content

Updating associated models with SQL-backed models and delta indexes #1182

@JasonBarnabe

Description

@JasonBarnabe

A Script has a many-to-many relationship with a User. The User's name is part of the Script index.

I'm upgrading to thinking-sphinx 5.0.0. I've added:

ThinkingSphinx::Callbacks.append(self, behaviours: [:sql, :deltas])

to Script; works good, updates to Script trigger a delta job.

I'm having trouble making updates to User trigger deltas jobs for the associated Scripts. I've tried

ThinkingSphinx::Callbacks.append(self, :script, :behaviours => [:sql, :deltas]) {|instance| instance.scripts}

and

ThinkingSphinx::Callbacks.append(self, :script, :behaviours => [:sql, :deltas], :path => [:scripts])

in the User model - doesn't seem to do anything. How do I get this to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions