diff options
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 2 |
3 files changed, 3 insertions, 5 deletions
@@ -62,7 +62,7 @@ platforms :ruby do group :db do gem 'pg', '>= 0.11.0' - gem 'mysql', '>= 2.8.1' + gem 'mysql', '>= 2.8.1' if RUBY_VERSION < '2.0.0' gem 'mysql2', '>= 0.3.10' end end diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 9cec791faf..8acbc08e09 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -293,9 +293,7 @@ module ActiveRecord begin status = yield rescue ActiveRecord::Rollback - if defined?(@_start_transaction_state) - @_start_transaction_state[:level] = (@_start_transaction_state[:level] || 0) - 1 - end + @_start_transaction_state[:level] = (@_start_transaction_state[:level] || 0) - 1 status = nil end diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 77cab6f08d..5ce2a0bd08 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -331,7 +331,7 @@ module ActiveSupport #:nodoc: def require_or_load(file_name, const_path = nil) log_call file_name, const_path - file_name = $1 if file_name =~ /^(.*)\.rb$/ + file_name = $` if file_name =~ /\.rb\z/ expanded = File.expand_path(file_name) return if loaded.include?(expanded) |