Sha256: d414fe0fb4812a49e3e952e8087b6023bc819c176a577f19f3ef2f27bd61aaaf

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

module StrongMigrations
  module DatabaseTasks
    def migrate(...)
      super
    rescue => e
      if e.cause.is_a?(StrongMigrations::Error)
        # strip cause and clean backtrace
        def e.cause
          nil
        end

        def e.message
          super.sub("\n\n\n", "\n\n") + "\n"
        end

        unless Rake.application.options.trace
          def e.backtrace
            bc = ActiveSupport::BacktraceCleaner.new
            bc.add_silencer { |line| line =~ /strong_migrations/ }
            bc.clean(super)
          end
        end
      end

      raise e
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strong_migrations-2.0.2 lib/strong_migrations/database_tasks.rb