Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use frozen string literal in actionpack/ | Kir Shatrov | 2017-07-29 | 1 | -0/+2 |
| | |||||
* | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string" | Matthew Draper | 2017-07-02 | 1 | -1/+0 |
| | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa. | ||||
* | Enforce frozen string in Rubocop | Kir Shatrov | 2017-07-01 | 1 | -0/+1 |
| | |||||
* | Add support for calling nested direct routes (#28462) | Andrew White | 2017-03-17 | 1 | -4/+4 |
| | | | | | | | | | | | | | | | | | | | | Not all requirements can be expressed in terms of polymorphic url options so add a `route_for` method that allows calling another direct route (or regular named route) which a set of arguments, e.g: resources :buckets direct :recordable do |recording| route_for(:bucket, recording.bucket) end direct :threadable do |threadable| route_for(:recordable, threadable.parent) end This maintains the context of the original caller, e.g. threadable_path(threadable) # => /buckets/1 threadable_url(threadable) # => http://example.com/buckets/1 | ||||
* | Push option extract into call method | Andrew White | 2017-02-21 | 1 | -3/+3 |
| | |||||
* | Support mapping of non-model classes | Andrew White | 2017-02-21 | 1 | -3/+10 |
| | |||||
* | Add custom polymorphic mapping | Andrew White | 2017-02-21 | 1 | -3/+24 |
| | | | | | | | | | | | | | | | | Allow the use of `direct` to specify custom mappings for polymorphic_url, e.g: resource :basket direct(class: "Basket") { [:basket] } This will then generate the following: >> link_to "Basket", @basket => <a href="/basket">Basket</a> More importantly it will generate the correct url when used with `form_for`. Fixes #1769. | ||||
* | Add more rubocop rules about whitespaces | Rafael Mendonça França | 2016-10-29 | 1 | -3/+3 |
| | |||||
* | revises more Lint/EndAlignment offenses | Xavier Noria | 2016-08-08 | 1 | -3/+3 |
| | |||||
* | Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty lines | Ryuta Kamizono | 2016-08-07 | 1 | -2/+0 |
| | |||||
* | normalizes indentation and whitespace across the project | Xavier Noria | 2016-08-06 | 1 | -132/+132 |
| | |||||
* | modernizes hash syntax in actionpack | Xavier Noria | 2016-08-06 | 1 | -2/+2 |
| | |||||
* | applies new string literal convention in actionpack/lib | Xavier Noria | 2016-08-06 | 1 | -7/+7 |
| | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default. | ||||
* | [ci skip] Fix typo & add link in PolymorphicRoutes | Alex Kitchens | 2016-06-29 | 1 | -2/+2 |
| | |||||
* | refactor `handle_model` to use private helper methods for generation | Aaron Patterson | 2015-03-01 | 1 | -8/+6 |
| | |||||
* | drop allocations for string and class polymorphic routes | Aaron Patterson | 2015-03-01 | 1 | -3/+3 |
| | |||||
* | drop allocations when handling model url generation | Aaron Patterson | 2015-02-28 | 1 | -1/+1 |
| | |||||
* | Fix form_for to work with objects that implement to_model | Travis Grathwell | 2014-12-29 | 1 | -5/+6 |
| | | | | | | | | | | | | | Previously, if you tried to use form_for with a presenter object that implements to_model, it would crash in action_dispatch/routing/polymorphic_routes.rb when asking the presenter whether it is .persisted? Now, we always ask .persisted? of the to_model object instead. This seems to been an issue since 1606fc9d840da869a60213bc889da6fcf1fdc431 Signed-off-by: Eugenia Dellapenna <eugenia.dellapenna@gmail.com> | ||||
* | Remove ActionController::ModelNaming | claudiob | 2014-12-25 | 1 | -4/+0 |
| | | | | | | | | | | | | | | The methods in these modules are not used anywhere. They used to be invoked in polymorphic_routes.rb but their usage was removed in e821045. What is your opinion about removing these methods? They do belong to the public API, but in reality their code has already been duplicated to ActionView::ModelNaming, since they are used by methods like `dom_id` and `dom_class` to associated records with DOM elements (in ActionView). Please tell me if you think that removing this module is a good idea and, in that case, if the PR is okay as it is, or you'd rather start by showing a deprecation message, and remove the module in Rails 5.1. | ||||
* | Keep the original implementation to not having to allocate new objects | Rafael Mendonça França | 2014-09-25 | 1 | -2/+15 |
| | |||||
* | Remove internal options from query string of paths | Gert Goet | 2014-09-25 | 1 | -18/+3 |
| | | | | Fixes #17057 | ||||
* | Allow polymorphic routes with nil when a route can still be drawn | Sammy Larbi | 2014-08-31 | 1 | -1/+2 |
| | | | | | | | | | | | | | | | | Suppose you have two resources routed in the following manner: ```ruby resources :blogs do resources :posts end resources :posts ``` When using polymorphic resource routing like `url_for([@blog, @post])`, and `@blog` is `nil` Rails should still try to match the route to the top-level posts resource. Fixes #16754 | ||||
* | Merge pull request #15889 from carnesmedia/model-name | Rafael Mendonça França | 2014-08-17 | 1 | -5/+5 |
|\ | | | | | | | Use #model_name on instances instead of classes | ||||
| * | Use #model_name on instances instead of classes | Amiel Martin | 2014-06-24 | 1 | -5/+5 |
| | | | | | | | | | | | | This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8 | ||||
* | | extract methods and metaprogram less. | Aaron Patterson | 2014-08-14 | 1 | -11/+16 |
|/ | |||||
* | Simplify merge call on polymorphic helpers | Carlos Antonio da Silva | 2014-05-13 | 1 | -2/+2 |
| | |||||
* | use the helper method builder to construct helper methods | Aaron Patterson | 2014-05-12 | 1 | -56/+107 |
| | |||||
* | undo optimized calls until the builder object is finished | Aaron Patterson | 2014-05-12 | 1 | -36/+19 |
| | |||||
* | remove suffix from the handler methods | Aaron Patterson | 2014-05-12 | 1 | -20/+19 |
| | |||||
* | push list handling to the builder object | Aaron Patterson | 2014-05-12 | 1 | -30/+30 |
| | |||||
* | push string handling to the builder object | Aaron Patterson | 2014-05-12 | 1 | -10/+8 |
| | |||||
* | push model and class handling to a helper builder object | Aaron Patterson | 2014-05-12 | 1 | -36/+48 |
| | |||||
* | adding a method to handle strings using the same api | Aaron Patterson | 2014-05-12 | 1 | -22/+32 |
| | |||||
* | break each polymorphic type to it's own method | Aaron Patterson | 2014-05-12 | 1 | -24/+81 |
| | |||||
* | remove dead code | Aaron Patterson | 2014-05-12 | 1 | -12/+0 |
| | |||||
* | only test `persisted?` on the record once | Aaron Patterson | 2014-05-12 | 1 | -3/+7 |
| | | | | | also avoid the case of calling `persisted?` on something that doesn't respond to it | ||||
* | only send options if there are any options | Aaron Patterson | 2014-05-12 | 1 | -5/+7 |
| | |||||
* | remove should_pop variable | Aaron Patterson | 2014-05-12 | 1 | -4/+1 |
| | |||||
* | only pop records when we get an array | Aaron Patterson | 2014-05-12 | 1 | -6/+7 |
| | |||||
* | remove unnecessary array allocations | Coraline Ada Ehmke + Aaron Patterson | 2014-05-12 | 1 | -5/+1 |
| | |||||
* | simplified route method name generation | Coraline Ada Ehmke + Aaron Patterson | 2014-05-12 | 1 | -27/+17 |
| | |||||
* | small refactoring | Coraline Ada Ehmke + Aaron Patterson | 2014-05-12 | 1 | -6/+2 |
| | |||||
* | pulling helpermethods up before refactoring | Coraline Ada Ehmke + Aaron Patterson | 2014-05-12 | 1 | -20/+46 |
| | |||||
* | push all is_a tests up, always pass options to the named route | Aaron Patterson | 2014-05-12 | 1 | -28/+27 |
| | |||||
* | pull nil checks up | Aaron Patterson | 2014-05-12 | 1 | -3/+5 |
| | |||||
* | skip another Array is_a check | Aaron Patterson | 2014-05-12 | 1 | -4/+6 |
| | |||||
* | only do the Array is_a check once | Aaron Patterson | 2014-05-12 | 1 | -4/+3 |
| | |||||
* | we always convert this variable to a list, so we can remove the unconversion | Aaron Patterson | 2014-05-12 | 1 | -1/+0 |
| | |||||
* | record as a hash is not possible, so rm branch | Aaron Patterson | 2014-05-12 | 1 | -2/+0 |
| | |||||
* | stop popping in build_named_route_call | Aaron Patterson | 2014-05-12 | 1 | -4/+3 |
| |