Closed khiav223577 closed 6 years ago
(The PR that supporting #deep_pluck at active model: https://github.com/khiav223577/deep_pluck/pull/19)
It works fine If you pluck deeply into associations
user.deep_pluck(:id, posts: :name)
But it will raise ArgumentError if you pluck attributes only
ArgumentError
user.deep_pluck(:id)
Though you can always rewrite it by as_json method
as_json
user.as_json(only: :id)
no 🐛should live
(The PR that supporting #deep_pluck at active model: https://github.com/khiav223577/deep_pluck/pull/19)
It works fine If you pluck deeply into associations
But it will raise
ArgumentError
if you pluck attributes onlyThough you can always rewrite it by
as_json
methodno 🐛should live