This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HACK: | |
# There is a deprecation of '-i' flag for pg_dump command, appeared in Postgres 9.5 | |
# The following rake task overrides the default `rake db:structure:dump` to be able to dump db structure without upgrading ActiveRecord. | |
# @ref: https://github.com/rails/rails/issues/23030#issuecomment-171084067 | |
require 'shellwords' | |
module ActiveRecord | |
module Tasks # :nodoc: | |
class PostgreSQLDatabaseTasks # :nodoc: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Migrator | |
def migrate(&block) | |
current = migrations.detect { |m| m.version == current_version } | |
target = migrations.detect { |m| m.version == @target_version } | |
if target.nil? && @target_version && @target_version > 0 | |
raise UnknownMigrationVersionError.new(@target_version) | |
end | |
start = up? ? 0 : (migrations.index(current) || 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void *rb_rdiscount_to_html_no_gvl(void * param_block){ | |
rb_discount_to_html_param_block *block = (rb_discount_to_html_param_block*)param_block; | |
block->doc = mkd_string(block->input, block->input_length, block->flags); | |
if(mkd_compile(block->doc, block->flags)){ | |
block->szres = mkd_document(block->doc, &block->res); | |
} | |
return NULL; | |
} | |
/*wrapper function. only exists because we need to pass a function pointer to rb_ensure*/ |