You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with paper_trail 3.0.7 and objects with custom setters don't properly reify. I'm running into this issue specifically with the acts-as-taggable-on gem. This gem introduces a tag_list getter and setter as an interface to handle multiple tags via a string.
The object I'm trying to reify has a tag_list attribute in it, but this fails with the following error:
from /usr/lib64/ruby/gems/2.0.0/gems/activerecord-4.0.13/lib/active_record/attribute_methods/dirty.rb:70:in `write_attribute'
from /usr/lib64/ruby/gems/2.0.0/gems/activerecord-4.0.13/lib/active_record/attribute_methods.rb:359:in `[]='
from /usr/lib64/ruby/gems/2.0.0/gems/paper_trail-3.0.7/lib/paper_trail/version_concern.rb:152:in `block (2 levels) in reify'
from /usr/lib64/ruby/gems/2.0.0/gems/paper_trail-3.0.7/lib/paper_trail/version_concern.rb:150:in `each'
from /usr/lib64/ruby/gems/2.0.0/gems/paper_trail-3.0.7/lib/paper_trail/version_concern.rb:150:in `block in reify'
from /usr/lib64/ruby/gems/2.0.0/gems/paper_trail-3.0.7/lib/paper_trail/version_concern.rb:225:in `call'
from /usr/lib64/ruby/gems/2.0.0/gems/paper_trail-3.0.7/lib/paper_trail/version_concern.rb:225:in `without_identity_map'
from /usr/lib64/ruby/gems/2.0.0/gems/paper_trail-3.0.7/lib/paper_trail/version_concern.rb:117:in `reify'
This happens because the specific code in version_concern.rb checks if the object reponds to "tag_list=" (which is does), but then proceeds to use "object[:tag_list] =" instead, which is not the same thing. I would at least expect the check and method to match so it would produce consistent results. I would also expect the setter to be called so that acts-as-taggable-on can do its magic on the tag_list value.
The text was updated successfully, but these errors were encountered:
I believe PR #512 would fix this... I just need to do a bit more research to see what (if any) ramifications there are by changing it / figure out why it was using the object[:tag_list] = syntax in the first place..
I'm working with paper_trail 3.0.7 and objects with custom setters don't properly reify. I'm running into this issue specifically with the acts-as-taggable-on gem. This gem introduces a tag_list getter and setter as an interface to handle multiple tags via a string.
The object I'm trying to reify has a tag_list attribute in it, but this fails with the following error:
This happens because the specific code in version_concern.rb checks if the object reponds to "tag_list=" (which is does), but then proceeds to use "object[:tag_list] =" instead, which is not the same thing. I would at least expect the check and method to match so it would produce consistent results. I would also expect the setter to be called so that acts-as-taggable-on can do its magic on the tag_list value.
The text was updated successfully, but these errors were encountered: