active_record_shards 2.4.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,8 @@ module ActiveRecordShards
44
44
 
45
45
  def migrate_with_forced_shard(direction)
46
46
  if migration_shard.blank?
47
- raise "Can't run migrations with a shard spec: this may be :all, :none, or a specific shard (for data-fixups) please call shard(arg) in your migration"
47
+ raise "#{self.name}: Can't run migrations without a shard spec: this may be :all, :none,
48
+ or a specific shard (for data-fixups). please call shard(arg) in your migration."
48
49
  end
49
50
 
50
51
  shard = ActiveRecord::Base.current_shard_selection.shard
@@ -58,6 +58,12 @@ class MigratorTest < ActiveSupport::TestCase
58
58
  end
59
59
 
60
60
  def test_bad_migration
61
+ begin
62
+ CowardlyMigration.up
63
+ rescue Exception => e
64
+ assert_match /CowardlyMigration/, e.message
65
+ end
66
+
61
67
  assert_raises(RuntimeError) do
62
68
  CowardlyMigration.up
63
69
  end