rails / 7.0.0 / activemodel / type.html /

module ActiveModel::Type

Public Class Methods

register (type_name, klass = nil, &block) Show source
# File activemodel/lib/active_model/type.rb, line 29
def register(type_name, klass = nil, &block)
  registry.register(type_name, klass, &block)
end

Add a new type to the registry, allowing it to be referenced as a symbol by attribute.

© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.