1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reuse the same ActiveModel::Type::Value

This commit is contained in:
alpaca-tc 2020-12-23 18:08:52 +09:00
parent e0fb817ffd
commit 8034a439c7

View file

@ -16,7 +16,7 @@ module ActiveModel
end
module ClassMethods
def attribute(name, type = Type::Value.new, **options)
def attribute(name, type = Type.default_value, **options)
name = name.to_s
if type.is_a?(Symbol)
type = ActiveModel::Type.lookup(type, **options.except(:default))