No results found in HouseTrip Deck.
Best results in other decks
An association defined with has_many :through will return the same record multiple times if multiple join models for the same record exist (a n:m relation). To prevent this...
invoice_id product_id 11 1001 55 12 1001 55 Now #products will return the product with ID #55 two times for this invoice: invoice = Invoice.find(1001) invoice.products # => [# , # ]
...IN (?)", excluded_ids) When the exclusion list is empty, you would expect this to return all records. However, this is not what happens: # Broken example User.where("id NOT IN (?)", []).to...
...SELECT `users`.* FROM `users` WHERE (id NOT IN (NULL)) Passing an empty exclusion list returns no records at all! See below for better implementations. Rails 4+ Use the .not method...