Skip to content

Does not respect association ON clause (acts_as_paranoid) #570

@mrbrdo

Description

@mrbrdo

Let's say the Translation model includes acts_as_paranoid.
Typical Rails Base.all.joins(:translations) will correctly have INNER JOIN ... ON ... ."deleted_at" IS NULL
However, the scopes/queries generated by Mobility will not include this ON condition.

I'm not sure how to go about fixing this... It seems the ActiveRecord interface to joins is mostly private and I didn't find a way to get a complete join (e.g. Arel join with all conditions) from ActiveRecord. I didn't find a way in ActiveRecord to perform a join with a table alias (for an association with taking into account the ON conditions).
Any suggestion? Is there at least a single place / setting in Mobility where it would be possible to add the additional conditions for the joins Mobility generates internally?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions