diff options
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 12 | ||||
-rw-r--r-- | activerecord/lib/active_record/transactions.rb | 6 |
3 files changed, 4 insertions, 16 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index f57d88d1a5..522012063d 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -187,7 +187,7 @@ module ActionDispatch # Get all the symbol nodes followed by literals that are not the # dummy node. symbols = ast.find_all { |n| - n.cat? && n.left.symbol? && n.right.cat? + n.cat? && n.left.symbol? && n.right.cat? && n.right.left.literal? }.map(&:left) # Get all the symbol nodes preceded by literals. diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 178cd41922..a39fede5b9 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -94,18 +94,6 @@ class LegacyRouteSetTests < ActiveSupport::TestCase assert_equal({"artist"=>"journey", "song"=>"faithfully"}, hash) end - def test_symbols_with_dashes_reversed - rs.draw do - get ':artist(/omg-:song)', :to => lambda { |env| - resp = ActiveSupport::JSON.encode ActionDispatch::Request.new(env).path_parameters - [200, {}, [resp]] - } - end - - hash = ActiveSupport::JSON.decode get(URI('http://example.org/journey/omg-faithfully')) - assert_equal({"artist"=>"journey", "song"=>"faithfully"}, hash) - end - def test_id_with_dash rs.draw do get '/journey/:id', :to => lambda { |env| diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 38ab1f3fc6..77c2845d88 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -233,19 +233,19 @@ module ActiveRecord set_callback(:commit, :after, *args, &block) end - # Shortcut for +after_commit :hook, on: :create+. + # Shortcut for <tt>after_commit :hook, on: :create</tt>. def after_create_commit(*args, &block) set_options_for_callbacks!(args, on: :create) set_callback(:commit, :after, *args, &block) end - # Shortcut for +after_commit :hook, on: :update+. + # Shortcut for <tt>after_commit :hook, on: :update</tt>. def after_update_commit(*args, &block) set_options_for_callbacks!(args, on: :update) set_callback(:commit, :after, *args, &block) end - # Shortcut for +after_commit :hook, on: :destroy+. + # Shortcut for <tt>after_commit :hook, on: :destroy</tt>. def after_destroy_commit(*args, &block) set_options_for_callbacks!(args, on: :destroy) set_callback(:commit, :after, *args, &block) |