Skip to content

Commit

Permalink
Merge 3a5356a into 7dcbc33
Browse files Browse the repository at this point in the history
  • Loading branch information
atomical committed Apr 17, 2023
2 parents 7dcbc33 + 3a5356a commit c8ae640
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/schema_plus/core/schema_dump.rb
Expand Up @@ -105,6 +105,13 @@ def assemble(stream, typelen, namelen)
pr += ',' unless options.blank?
stream.write "%-#{namelen+3}s " % pr
end
if Gem::Version.new(::ActiveRecord::VERSION::STRING) >= Gem::Version.new('5.0.0')
if options[:default].is_a?(Proc) &&
default = options.delete(:default)
stream.write "default: -> { \"#{default.call}\" }"
stream.write ", " unless options.blank?
end
end
stream.write options.to_s.sub(/^{(.*)}$/, '\1') unless options.blank?
stream.write ' ' unless options.blank? or comments.blank?
stream.write '# ' + comments.join('; ') unless comments.blank?
Expand Down

0 comments on commit c8ae640

Please sign in to comment.