diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:35:13 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:35:13 +0200 |
commit | 5b6eb1d58b48fada298215b2cccda89f993890c3 (patch) | |
tree | a48010fd8c35588540f50df257a76347091aca12 /actionpack/lib/action_dispatch/routing/mapper.rb | |
parent | 12a70404cd164008879e63cc320356e6afee3adc (diff) | |
download | rails-5b6eb1d58b48fada298215b2cccda89f993890c3.tar.gz rails-5b6eb1d58b48fada298215b2cccda89f993890c3.tar.bz2 rails-5b6eb1d58b48fada298215b2cccda89f993890c3.zip |
modernizes hash syntax in actionpack
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 76429958b3..405a8f229c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -614,7 +614,7 @@ module ActionDispatch target_as = name_for_action(options[:as], path) options[:via] ||= :all - match(path, options.merge(:to => app, :anchor => false, :format => false)) + match(path, options.merge(to: app, anchor: false, format: false)) define_generate_prefix(app, target_as) if rails_app self @@ -985,7 +985,7 @@ module ActionDispatch # resources :iphones # end def constraints(constraints = {}) - scope(:constraints => constraints) { yield } + scope(constraints: constraints) { yield } end # Allows you to set default parameters for a route, such as this: @@ -1801,7 +1801,7 @@ to this: end def resource_scope(resource) #:nodoc: - @scope = @scope.new(:scope_level_resource => resource) + @scope = @scope.new(scope_level_resource: resource) controller(resource.resource_scope) { yield } ensure @@ -1809,7 +1809,7 @@ to this: end def nested_options #:nodoc: - options = { :as => parent_resource.member_name } + options = { as: parent_resource.member_name } options[:constraints] = { parent_resource.nested_param => param_constraint } if param_constraint? @@ -1836,8 +1836,8 @@ to this: end def shallow_scope #:nodoc: - scope = { :as => @scope[:shallow_prefix], - :path => @scope[:shallow_path] } + scope = { as: @scope[:shallow_prefix], + path: @scope[:shallow_path] } @scope = @scope.new scope yield @@ -2122,7 +2122,7 @@ to this: def initialize(set) #:nodoc: @set = set - @scope = Scope.new({ :path_names => @set.resources_path_names }) + @scope = Scope.new({ path_names: @set.resources_path_names }) @concerns = {} end |