lundi 2 mai 2016

Making sense of this Rails joins

This method is inside a table called Delivery.

def self.by_delivery(delivery_ids:, without_alternate: false)
    pairings = joins(
      paired_product: {
        delivery_products: [
        :delivery,
        product_slot: {
          product_configuration_slots: :product_configuration
        }
      ]
    })

I read this and this

I'm still confused what this doing. In english is this retrieving rows where the delivery's paired_product has delivery_products which... and now I don't understand the significance of the array after delivery_products.

Where can I find documentation on this usage?

Aucun commentaire:

Enregistrer un commentaire