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

need serializer support #16

Open
kakas opened this issue Oct 2, 2017 · 1 comment
Open

need serializer support #16

kakas opened this issue Oct 2, 2017 · 1 comment

Comments

@kakas
Copy link

kakas commented Oct 2, 2017

可否支援 deep_pluck 出 model 裡面序列化的欄位?

e.g
class User < ActiveRecord::Base
  serialize :preferences, Hash
end

# in controller

User.where(id: 1).deep_pluck(preferences: [:food, :car])
@khiav223577
Copy link
Owner

以目前 deep_pluck 的設計

users.deep_pluck(preferences: [:food, :car])

預期的輸出格式會是:

[
  {preferences: [{food: xx, car: xx}, {food: xx, car: xx}, ......]}, # user1
  {preferences: [{food: xx, car: xx}, {food: xx, car: xx}, ......]}, # user2
  ...
  ...
]

跟你想要的不太一樣

可能要再想想語法格式的問題

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

2 participants