No commit activity in last 3 years
No release in over 3 years
It simplifies creation of enums which are supposed to have one-to-one mapping to their keys and values.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

 Project Readme

StringifiedEnum

How to use?

in your Gemfile

gem "stringified_enum"

in you ActiveRecord model

class Item < ApplicationRecord
  include StringifiedEnum

  stringified_enum status: %i(active inactive)
end

How does it work?

It works as a shortcut for the original ActiveRecord::Enum definition. For example the code above is equivalent to:

class Item < ApplicationRecord
  enum status: { active: "active", inactive: "inactive" }
end