brendon / acts_as_list

An ActiveRecord plugin for managing lists.
http://brendon.github.io/acts_as_list/
MIT License
2.05k stars 356 forks source link

Only swap changed attributes which are persistable, i.e. are DB columns. #152

Closed ludwigschubert closed 9 years ago

ludwigschubert commented 9 years ago

This patches an issue where acts_as_list would try to swap virtual attributes, resulting in a crashing ActiveRecord write_attribute method.

I observed this issue in combination with acts_as_taggable, I have attached a partial stack trace here. My solution built on a similar fix for the paper_trail gem, from this PR.

ludwigschubert commented 9 years ago

@swanandp I'd still like to see this merged. Is there anything I can do to make this easier for you? Would you like me to add a test for a specific case?

swanandp commented 9 years ago

Looks good to me.

ludwigschubert commented 9 years ago

@swanandp thank you!