Skip to content

Commit

Permalink
Try to fix brakeman
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonin committed Sep 14, 2018
1 parent f43fa81 commit e8b5061
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/extensions/ar_migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ def self.update_local_migrations_ran(version, direction)

new_migrations = ActiveRecord::SchemaMigration.normalized_versions
new_migrations << version if direction == :up
migrations_value = ActiveRecord::Base.connection.quote(PG::TextEncoder::Array.new.encode(new_migrations))

ActiveRecord::Base.connection.exec_query(<<~SQL)
UPDATE #{MiqRegion.table_name}
SET migrations_ran = '#{PG::TextEncoder::Array.new.encode(new_migrations)}'
SET migrations_ran = #{migrations_value}
WHERE id = #{region.id}
SQL
end
Expand Down

0 comments on commit e8b5061

Please sign in to comment.