No commit activity in last 3 years
No release in over 3 years
This gem does the same as ActiveRecord::Base#enum but does not define enum_value? and enum_value! methods so you can use the same values in multiple enum
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

activerecord-enum-without-methods

This gem does the same as ActiveRecord::Base#enum in Rails >= 4.1 but does not define enum_value? and enum_value! methods so you can use the same value in multiple enums.

It's a solution if you get the following error:

ArgumentError: You tried to define an enum named "..." on the model "...", but this will generate a instance method "...?", which is already defined by another enum.

Usage

class MyModel < ActiveRecord::Base
  enum_without_methods enum1: [ :a, :b ]
  enum_without_methods enum2: [ :a, :b ]
end

License

MIT