hzamani / acts_as_relation

Multi table Inheritance for rails
http://hzamani.github.com/acts_as_relation/
MIT License
180 stars 58 forks source link

Controller update_attributes issue: 'ActiveRecord::ReadOnlyRecord' #13

Closed PaulAik closed 12 years ago

PaulAik commented 12 years ago

If I try to update an acts_as_relation model in my controller, I get the following error:

"ActiveRecord::ReadOnlyRecord"

I believe this is something to do with the join on the object's tables (superclass + class tables). I think there should be a '.readonly(false)' in there somewhere, but I'm not sure how to add.

What's the recommended method of updating acts_as_relation objects via forms (e.g. form POST)?

hzamani commented 12 years ago

What version of AR do you use, and where do you get "ActiveRecord::ReadOnlyRecord"?

There might be no difference between createing and updateing object, can you explain more? And it's better to handel all models that acts as same parent in a single controller.

wharle90 commented 12 years ago

I've encountered this same error. AR is at 3.2.0. Anytime I get one of my classes it will not let me even call save on the object without throwing this same error. Any ideas?

hzamani commented 12 years ago

fixed thanks to wharle90