Sha256: 89ccf931b9a27537b5690a6394fe38e70d5e9684e26468c38cc5dadbbfc1c8bd

Contents?: true

Size: 607 Bytes

Versions: 9

Compression:

Stored size: 607 Bytes

Contents

module StrongMigrations
  module DatabaseTasks
    def migrate
      super
    rescue => e
      if e.cause.is_a?(StrongMigrations::UnsafeMigration)
        # 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

9 entries across 9 versions & 1 rubygems

Version Path
strong_migrations-0.5.1 lib/strong_migrations/database_tasks.rb
strong_migrations-0.5.0 lib/strong_migrations/database_tasks.rb
strong_migrations-0.4.2 lib/strong_migrations/database_tasks.rb
strong_migrations-0.4.1 lib/strong_migrations/database_tasks.rb
strong_migrations-0.4.0 lib/strong_migrations/database_tasks.rb
strong_migrations-0.3.1 lib/strong_migrations/database_tasks.rb
strong_migrations-0.3.0 lib/strong_migrations/database_tasks.rb
strong_migrations-0.2.3 lib/strong_migrations/database_tasks.rb
strong_migrations-0.2.2 lib/strong_migrations/database_tasks.rb