Skip to content
  • Mat Trudel's avatar
    Build conditions & joins per rule then merge them after · 05b0f058
    Mat Trudel authored
    Per https://github.com/CanCanCommunity/cancancan/issues/337, this commit refactors the internals of the active record adapter. This strips out a lot of idiosyncratic complexity inherent in building conditions and joins separately, and also allows each rule's clauses to work within their own sub-select, thus fixing the issue outlined in the above ticket.
    
    The join-related tests removed from a_r_a_spec are now implicitly covered by the rewritten condition tests, since they now compare against complete SQL statements and thus include the joins where needed.
    05b0f058