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

ActsAsTaggableOn.remove_unused_tags doesn't work #560

Merged
merged 1 commit into from
Jun 21, 2014

Conversation

tonytonyjan
Copy link
Contributor

tag.destroy will never execute since taggings_count was cached in memory.

  • ruby (2.1.2)
  • rails (4.1.1)
  • acts-as-taggable-on (3.2.6)

@tonytonyjan
Copy link
Contributor Author

This pull request should pass the following test.

require 'spec_helper'
describe 'Patch' do
  it 'is supposed to work' do
    ActsAsTaggableOn::Tag.destroy_all
    ActsAsTaggableOn.remove_unused_tags = true
    @taggable = TaggableModel.create(name: 'Bob Jones')
    @taggable.update tag_list: 'aaa,bbb,ccc'
    @taggable.update tag_list: ''
    expect(ActsAsTaggableOn::Tag.count).to eql(0)
  end
end

@seuros
Copy link
Collaborator

seuros commented Jun 21, 2014

👍 Thank you

can you add the test here and stash your commits

@seuros
Copy link
Collaborator

seuros commented Jun 21, 2014

ensure to set ActsAsTaggableOn.remove_unused_tags to it previous value

@tonytonyjan
Copy link
Contributor Author

@seuros I'm glad I could help. acts-as-taggable-on is one of my favourite gems, thank you so much =D

@seuros
Copy link
Collaborator

seuros commented Jun 21, 2014

If you could stash your commits and force push , that will be great.

… memory.

* ruby (2.1.2)
* rails (4.1.1)
* acts-as-taggable-on (3.2.6)

This commit fix the bug and add a test as well.
@tonytonyjan
Copy link
Contributor Author

@seuros I finished. Please let me know if I missed anything else, thanks.

seuros added a commit that referenced this pull request Jun 21, 2014
Fix `ActsAsTaggableOn.remove_unused_tags`
@seuros seuros merged commit 11e38e0 into mbleigh:master Jun 21, 2014
@seuros
Copy link
Collaborator

seuros commented Jun 21, 2014

Thank you for your work

@tonytonyjan tonytonyjan deleted the patch-1 branch June 21, 2014 16:03
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this pull request Mar 19, 2021
Fix `ActsAsTaggableOn.remove_unused_tags`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants