Module: SimpleEnum::Persistence::Extension
- Included in:
- Attribute
- Defined in:
- lib/simple_enum/persistence/extension.rb
Instance Method Summary collapse
Instance Method Details
#as_enum(name, values, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/simple_enum/persistence/extension.rb', line 4 def as_enum name, values, = {} persistence = .delete :persistence if persistence [:with] ||= SimpleEnum.with.reject do |feature| [:attribute, :scope].include? feature end [:map] = :persistence values = [ values ] values.push persistence if persistence.kind_of? Hash end super end |