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

Use of custom delimiter changes tag_list #747

Closed
keerthisiv opened this issue Apr 16, 2016 · 0 comments
Closed

Use of custom delimiter changes tag_list #747

keerthisiv opened this issue Apr 16, 2016 · 0 comments

Comments

@keerthisiv
Copy link
Contributor

Changing the default delimiter creates an issue how tags are cached and returned when queried again

e.g
set the ActsAsTaggableOn.delimiter = ';'

create a new object that has taggable attribute
@taggable = CachedModel.new(name: 'Bob Jones')

update tag attribute
@taggable.update_attributes(tag_list: 'awesome; epic')

when queried for the tag_list returns
@taggable.tag_list

=> ["awesome", "epic"]

@taggable.cached_tag_list

=> "awesome, epic"

which is fine but when the object is retrieved again and queried the same the results are not as expected
@taggable = CachedModel.find_by_name('Bob Jones')
@taggable.tag_list

=> ["awesome, epic"]

@taggable.cached_tag_list

=> "awesome, epic"

As u can see the difference in tag_list from ["awesome", "epic"] to ["awesome, epic"] is the issue and investigating shows the problem is related to how the cached_tag_list is saved.

@keerthisiv keerthisiv changed the title Use of custom delimiter changes expected tag_list Use of custom delimiter changes tag_list Apr 16, 2016
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

No branches or pull requests

1 participant