diff options
Diffstat (limited to 'activerecord/lib/active_record/migration.rb')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 273af32237..67339c05e5 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -477,7 +477,7 @@ module ActiveRecord # end def reversible helper = ReversibleBlockHelper.new(reverting?) - transaction{ yield helper } + execute_block{ yield helper } end # Runs the given migration classes. @@ -639,6 +639,15 @@ module ActiveRecord "%.3d" % number end end + + private + def execute_block + if connection.respond_to? :execute_block + super # use normal delegation to record the block + else + yield + end + end end # MigrationProxy is used to defer loading of the actual migration classes |