aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey/formatter.rb
Commit message (Collapse)AuthorAgeFilesLines
* sort_by instead of sortYang Bo2015-04-081-1/+1
| | | | | | it is avoid sort errot within different and mixed keys. used `sort_by` + `block` to list parameter by keys. keep minimum changes
* Remove deprecated option `use_route` in controller testsRafael Mendonça França2015-01-041-15/+0
|
* Don't show the warning if we're already raising the error anywayGodfrey Chan2014-11-231-8/+13
| | | | | | | | | If the route set is empty, or if none of the routes matches with a score > 0, there is no point showing the deprecation message because we are already be raising the `ActionController::UrlGenerationError` mentioned in the warning. In this case it is the expected behavior and the user wouldn't have to take any actions.
* Deprecate passing an invalid name to `Formatter#generate`Godfrey Chan2014-11-231-0/+10
| | | | | | | | The internal tests that (incorrectly) relied on this were already fixed in 938d130. However, we cannot simply fix this bug because the guides prior to b7b9e92 recommended a workaround that relies on this buggy behavior. Reference #17453
* fix url generation error messageAccessd2014-10-211-1/+1
|
* `recall` should be `path_parameters`, also make it requiredAaron Patterson2014-07-171-3/+3
| | | | | | | | "recall" is a terrible name. This variable contains the parameters that we got from the path (e.g. for "/posts/1" it has :controller => "posts", :id => "1"). Since it contains the parameters we got from the path, "path_parameters" is a better name. We always pass path_parameters to `generate`, so lets make it required.
* Remove AD::Journey::Formatter#verify_required_parts!Viktar Basharymau2014-05-231-5/+0
| | | | | Nobody uses this private method, maybe it is a leftover from some old refactoring. Let's delete it.
* Merge pull request #15254 from DNNX/formatter-refactoring-3Rafael Mendonça França2014-05-221-4/+4
|\ | | | | Rename `stack` to `queue`
| * Rename `stack` to `queue`Viktar Basharymau2014-05-221-4/+4
| | | | | | | | | | | | | | Because it is used as a queue (FIFO), not as a stack (LIFO). * http://en.wikipedia.org/wiki/Stack_(abstract_data_type) * http://en.wikipedia.org/wiki/Queue_(data_structure)
* | Merge pull request #15252 from DNNX/formatter-refactoring-2Rafael Mendonça França2014-05-221-1/+1
|\ \ | | | | | | Remove unnecessary `Hash#to_a` call
| * | Remove unnecessary `Hash#to_a` callViktar Basharymau2014-05-221-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by https://github.com/rails/rails/commit/931ee4186b877856b212b0085cd7bd7f6a4aea67 ```ruby def stat(num) start = GC.stat(:total_allocated_object) num.times { yield } total_obj_count = GC.stat(:total_allocated_object) - start puts "#{total_obj_count / num} allocations per call" end h = { 'x' => 'y' } stat(100) { h. each { |pair| pair } } stat(100) { h.to_a.each { |pair| pair } } __END__ 1 allocations per call 2 allocations per call ```
* / Use `break` instead of `next` in AD::Journey::Formatter#match_routeViktar Basharymau2014-05-221-1/+1
|/ | | | | | The array is sorted in descending order, so there is no point in iterating further if we met a negative item - all the rest will be negative too.
* do not mutate parameters, let the caller do mutationsAaron Patterson2014-05-211-0/+6
|
* we don't use this parameter for anything, so rmAaron Patterson2014-05-201-1/+1
|
* Replace map.flatten(1) with flat_mapErik Michaels-Ober2014-02-281-2/+2
|
* Show full route constraints in error messageAndrew White2014-01-051-2/+2
| | | | | | | | When an optimized helper fails to generate, show the full route constraints in the error message. Previously it would only show the contraints that were required as part of the path. Fixes #13592
* Skip Rack applications and redirects when generating urlsAndrew White2013-07-161-1/+5
| | | | | | | | | | When generating an unnamed url (i.e. using `url_for` with an options hash) we should skip anything other than standard Rails routes otherwise it will match the first mounted application or redirect and generate a url with query parameters rather than raising an error if the options hash doesn't match any defined routes. Fixes #8018
* rails -> Rails [ci skip]Prathamesh Sonpatki2013-05-091-1/+1
|
* Mark unused variables and make some style fixesAgis Anastasopoulos2013-04-081-1/+1
| | | | It'd be a nice convention to mark the unused variables like this, now that Ruby 2 will issue no warnings for such vars being unused.
* Raise correct exception now Journey is integrated.Andrew White2013-01-151-1/+6
| | | | | | | Now that Journey has been integrated into ActionDispatch we can raise the exception ActionController::UrlGenerationError directly rather than raising the internal Journey::Router::RoutingError and then have ActionDispatch::Routing::RouteSet#generate re-raise the exception.
* remove another unnecessary dupGosha Arinich2013-01-021-5/+3
|
* remove unnecessary #dupGosha Arinich2013-01-021-2/+1
|
* update AD::Journey to follow Rails coding conventionsFrancesco Rodriguez2012-12-201-84/+82
|
* :nodoc: Journey because is not part of the public API [ci skip]Francesco Rodriguez2012-12-191-6/+5
|
* Integrate Journey into Action DispatchAndrew White2012-12-191-0/+147
Move the Journey code underneath the ActionDispatch namespace so that we don't pollute the global namespace with names that may be used for models. Fixes rails/journey#49.