Allow attribute's default to be configured but keeping its own type by kamipo · Pull Request #39830 · rails/rails

class Post < ActiveRecord::Base attribute :written_at, defaullt: -> { Time.now.utc } end # Rails 6.0 Post.type_for_attribute(:written_at) # => #<Type::Value ... precision: nil, ...> # Rails 6.1...</type::value>