active_record_shards 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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