Read more

Understand ActiveRecord::ReadOnlyRecord error

Henning Koch
September 10, 2010Software engineer at makandra GmbH

When you load a record with find options that have SQL fragments in :select or :joins, ActiveRecord will make that record read-only. This is a protective measure by Rails because such a record might have some additional attributes that don't correspond to actual table columns.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

You can override that precaution by appending :readonly => false to affected find options or scope options.

Posted by Henning Koch to makandra dev (2010-09-10 14:25)