Rails: How to get Model where “join_table.attrbute = x” joined, but also all the other

Rails: How to get Model where “join_table.attrbute = x” joined, but also all the other

I have a model Company, and a join model Note, which has user_id and company_id. Company has_many notes. Note belongs_to user and company. I'm trying to fetch a list of companies together with notes for a user if it has any, but also all the other companies.

I have a model Company, and a join model Note, which has user_id and company_id. Company has_many notes. Note belongs_to user and company. I'm trying to fetch a list of companies together with notes for a user if it has any, but also all the other companies.

Obviously, doing Company.joins(:notes).where("notes.user_id = 1") only get me the ones which has notes and not the others. What am I missing here?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

How To Use PostgreSQL with Your Ruby on Rails Application on macOS

In this tutorial, you will set up a Ruby on Rails development environment connected to a PostgreSQL database on a local macOS machine. You will install and configure PostgreSQL, and then test your setup by creating a Rails application that uses PostgreSQL as its database server.