Are you absolutely sure your `has_one` association really has one association?

Learn about an unexpected limitation with this API and how to combat it universally.The Rails has_one API has an unexpected limitation: It does not prevent multiple records from being associated to the parent record.Take this simple example straight from the Rails Guides. We have a supplier that has_one account. Seems simple enough, but let’s take a closer look.
Are you absolutely sure your `has_one` association really has one association? #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/are-you-absolutely-sure-your-has_one-association-really-has-one-association

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles