Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing a tag from a record affects to all records having the same tag name. #538

Closed
github0013 opened this issue May 16, 2014 · 6 comments
Assignees
Labels
Milestone

Comments

@github0013
Copy link

environments

$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-darwin13.1.0]

$ uname -a
Darwin test.local 13.1.0 Darwin Kernel Version 13.1.0: Wed Apr  2 23:52:02 PDT 2014; root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64

I prepared a repo for this issue.

git clone https://github.com/github0013/tag_issue.git
bundle
rake db:create; rake db:migrate
rails c

then run this

%w[one two three].each{|name| Post.create name: name, tag_list: "a,b,c" }
Post.all.each{|post| p post.tag_list }
# will return 3 lines
# ["a", "b", "c"]
# ["a", "b", "c"]
# ["a", "b", "c"]

Post.last.update tag_list: "a,b" # remove tag "c" ONLY from the last record

Post.all.each{|post| p post.tag_list }
# will return 3 lines.  tag "c" is removed from all records... why?
# ["a", "b"]
# ["a", "b"]
# ["a", "b"]

I am only removing tag "c" ONLY from the last record, but tag "c" is removed from ALL.

@seuros seuros added the bug label May 16, 2014
@seuros seuros added this to the 3.2.0 milestone May 16, 2014
@seuros
Copy link
Collaborator

seuros commented May 16, 2014

Wow, thank you. That a serious bug, i will try to fix it today.

Tip : you can chain rake commands

rake db:create db:migrate

that way, if the first fail, the second won't be executed.

seuros added a commit to seuros/acts-as-taggable-on that referenced this issue May 16, 2014
seuros added a commit to seuros/acts-as-taggable-on that referenced this issue May 16, 2014
@seuros seuros closed this as completed in 54e85b9 May 16, 2014
seuros added a commit that referenced this issue May 16, 2014
[Bug fix] Fixes #538
Version bump
@seuros seuros self-assigned this May 16, 2014
@seuros
Copy link
Collaborator

seuros commented May 16, 2014

@github0013 , Thank you for reporting this bug and providing details

@github0013
Copy link
Author

that was very quick fix.
now I can get back to my project, thanks! and the tip for rake command ;)

@cknoxrun
Copy link

It seems this is only fixed on master, or there has been a regression. I was still getting this issue on the latest release until pointing to master.

@seuros
Copy link
Collaborator

seuros commented May 30, 2014

Can you double check ? The version in rubygem is exactly the one in master .

@cknoxrun
Copy link

Sigh, nevermind, it seems like spring didn't reload the gem when I updated it. Stopping spring and reloading the server fixed the issue. My bad.

tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants