aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/type.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/type.rb')
-rw-r--r--activemodel/lib/active_model/type.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/type.rb b/activemodel/lib/active_model/type.rb
index 095801d8f0..1d7a26fff5 100644
--- a/activemodel/lib/active_model/type.rb
+++ b/activemodel/lib/active_model/type.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "active_model/type/helpers"
require "active_model/type/value"
@@ -22,7 +24,7 @@ module ActiveModel
class << self
attr_accessor :registry # :nodoc:
- # Add a new type to the registry, allowing it to be get through ActiveModel::Type#lookup
+ # Add a new type to the registry, allowing it to be gotten through ActiveModel::Type#lookup
def register(type_name, klass = nil, **options, &block)
registry.register(type_name, klass, **options, &block)
end
@@ -30,6 +32,10 @@ module ActiveModel
def lookup(*args, **kwargs) # :nodoc:
registry.lookup(*args, **kwargs)
end
+
+ def default_value # :nodoc:
+ @default_value ||= Value.new
+ end
end
register(:big_integer, Type::BigInteger)