Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # frozen_string_literal: true
- # app/models/concerns
- module HasStringEnum
- extend ActiveSupport::Concern
- class_methods do
- def string_enum(name, values, **options)
- enum(name => values.zip(values).to_h, **options)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement