
dm-tags doesn't update tags when set through attributes
Reported by siplux | July 9th, 2009 @ 05:33 PM | in 0.10.0
If you attempt to update the tag_list via a hash of attributes rather than a method call, it will just delete existing tags without updating them. However, it will correctly set the frozen_tag_list even though it deletes existing tags.
Broken
IRB:
>> u = User.first
>> u.profession_list
=> ["Government"]
>> u.attributes(:profession_list => "Education") >> u.save
=> true
>> u = User.first >> u.profession_list
=> []
>> u.frozen_profession_list
=> "Education"
Works
IRB:
>> u = User.first
>> u.profession_list = "Education"
=> "Education"
>> u.save
=> true
>> u.profession_list
=> ["Education"]
Comments and changes to this ticket
-
Dan Kubb (dkubb) July 22nd, 2009 @ 03:49 PM
- State changed from new to unconfirmed
- Milestone cleared.
-
Martin Gamsjaeger (snusnu) August 18th, 2009 @ 08:18 PM
- Milestone set to 0.10.0
- State changed from unconfirmed to resolved
siplux,
What you want to do is to call the
attributes=
method that accepts aHash
. I tried your above snippet usingattributes=
and everything works as expected for me.Marking this resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »