My Invoice model has an address_id attribute, and I don't want this address_id to change FOREVER. So I don't want this to happen outside the class:
invoice.address_id = 1
invoice.address = some_address
Rails automatically adds this address_id attribute to the model from the invoice table, so how can I declare this attribute private/protected? Calling
attr_protected :address_id
is most likely not the solution since based on the documentation it only prevents mass assignments.
Thanks!