ActiveRecord get all ids
To speed up my development I use Populator gem. For a belongs_to relationship I need to get all the ids from my model. I use this tip
Object.pluck(:id)
This method is designed to perform select by a single column
Written by Jeremy Bertrand
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#