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

Doesn't work nicely with serialized attributes #5

Closed
DNNX opened this issue May 8, 2015 · 0 comments · Fixed by #7
Closed

Doesn't work nicely with serialized attributes #5

DNNX opened this issue May 8, 2015 · 0 comments · Fixed by #7

Comments

@DNNX
Copy link
Contributor

DNNX commented May 8, 2015

class Article < ActiveRecord::Base
  serialize :tags, Array
end

Article.create!(tags: [])
Article.create!(tags: ['Zygohistomorpic', 'Prepromorphism'])
Article.create!(tags: ['Comonad'])

Article.pluck(:tags) 
# => [[], ['Zygohistomorpic', 'Prepromorphism'], ['Comonad']]

Article.pluck_to_hash(:tags) 
# => [{tags: nil}, {tags: 'Zygohistomorpic'}, {tags: 'Comonad'}]

This is not what I expect, unfortunately :( Poor prepromorphism was lost somewhere.

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 a pull request may close this issue.

1 participant