I want to have a class with several attributes that saves weekdays with numeric values.
summary_weekday :integer
collection_weekday :integer
As of Rails 5.0 you can use the _prefix
or _suffix
options when you need to define multiple enums with same values. If the passed value is true, the methods are prefixed/suffixed with the name of the enum.
class Invoice < ActiveRecord::Base
enum verification: [:done, :fail], _prefix: true
end
It is also possible to supply a custom prefix.
class Invoice < ActiveRecord::Base
enum verification: [:done, :fail], _prefix: :verification_status
end