Project

hashed

0.0
No commit activity in last 3 years
No release in over 3 years
Provides `hashed` method to ActiveRecord dataset, that return hash where keys is value of some attribute of object (default – primary key of used table).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Hashed

Build Status

Provides hashed method to ActiveRecord objects-set that return hash where keys is value of some attribute of object (default – primary key of used table).

Put this line to your Gemfile

gem "hashed"

Then run bundle install and let's go!

Category.active.hashed
# equal to
Category.active.hashed(Category.primary_key)
# you may want to have hash not by primary_key
Category.active.hashed(:created_at)
# you may want to select only one field ({key: value})
Category.active.hashed(by: :created_at, only: :name)