invoice.address_id = 1 invoice.address = some_address
Rails会自动从发票表中将此address_id属性添加到模型中,那么我该如何声明此属性为private / protected?调用
attr_protected :address_id
很可能不是解决方案,因为根据文档,它只能防止大量分配.
谢谢!
attr_readonly