aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
Commit message (Collapse)AuthorAgeFilesLines
...
* Refector a bit to remove extra slice iteration and splat callCarlos Antonio da Silva2012-11-241-2/+2
| | | | | | | | | This yields a small bit of performance improvement when building the defaults from constraints, specially considering that it's rather common for constraints to be empty. Also, there's a bit of duplicated code in here that I have to check before extracting.
* Use merge! in some places to avoid creating extra hashesCarlos Antonio da Silva2012-11-242-4/+4
|
* Simplify scope options recovery by using merge!Carlos Antonio da Silva2012-11-241-6/+1
| | | | | | Instead of iterating again over the options and setting one by one, we can just merge the recover hash back to the scope one since all keys match.
* Normalize scope recovering :blocks option nameCarlos Antonio da Silva2012-11-241-3/+3
| | | | | Use the same :blocks key in the recover hash to revert the scope options later.
* Simplify constraints condition in scope when checking for HashCarlos Antonio da Silva2012-11-241-7/+4
|
* Allow setting a symbol as path in scope on routesGuillermo Iguaran2012-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Was surprising found that this example doesn't work: scope :api do resources :users end and the right form to use it is: scope 'api' do resources :users end I think this should work similary as `namespace` where both are allowed. These two are equivalent: namespace :api do resources :users end namespace 'api' do resources :user end
* Merge pull request #8183 from jcoglan/objectless_sessionsJon Leighton2012-11-211-10/+24
|\ | | | | Store FlashHashes in the session as plain hashes
| * Store FlashHashes in the session as plain hashes rather than custom objects ↵James Coglan2012-11-091-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with unstable class names and instance variables. Refactor FlashHash to take values for its ivars in the constructor, to pretty up FlashHash.from_session_value. Remove stale comment on FlashHash: it is no longer Marshaled in the session so we can change its implementation. Remove blank lines I introduced in controller/test_case.rb. Unit tests for FlashHash#to_session_value. Put in a compatibility layer to accept FlashHash serializations from Rails 3.0+. Test that Rails 3.2 session flashes are correctly converted to the new format. Remove code path for processing Rails 3.0 FlashHashes since they can no longer deserialize. Fix session['flash'] deletion condition: it will never be empty?, it will either be nil or a hash with 'discard' and 'flashes' keys.
* | Correct the use of params options when given to url_forCarlos Antonio da Silva2012-11-191-1/+1
| | | | | | | | Merge url for tests and add changelog entry for #8233.
* | Fix issue with params in url_fortumayun2012-11-191-1/+1
| | | | | | | | | | | | With a "params" argument, the following error is raised: undefined method `reject!` for "":String
* | Fix UpgradeSignatureToEncryptionCookieStore docSantiago Pastorino2012-11-191-9/+4
| |
* | Removed extra call to #diff in #assert_recognizes. assert_equal calls it for ↵Ryan Davis2012-11-171-4/+7
| | | | | | | | you and shows the diff. Also delayed message calculation so the cost of the diff on success is now gone.
* | Improve UpgradeSignatureToEncryptionCookieStore docsSantiago Pastorino2012-11-161-1/+14
| | | | | | | | | | I suck at English, please help me reviewing this <3 <3 <3 [ci skip]
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-171-17/+22
|\ \ | | | | | | | | | | | | Conflicts: actionpack/lib/action_dispatch/routing/redirection.rb
| * | update syntax and add note about prompt use of HttpHelpers [ci-skip]Cesar Carruitero2012-11-091-12/+17
| | |
| * | correct link syntax [ci-skip]Cesar Carruitero2012-11-091-5/+5
| | |
| * | change rdoc syntax for adecuate render [ci-skip]Cesar Carruitero2012-11-091-1/+1
| | |
| * | change match to get and add single quotes in routing/redirection [ci-skip]Cesar Carruitero2012-11-081-8/+8
| | |
* | | Add UpgradeSignatureToEncryptionCookieStoreSantiago Pastorino2012-11-162-2/+25
| | | | | | | | | | | | | | | | | | This allows easy upgrading from the old signed Cookie Store <= 3.2 or the deprecated one in 4.0 (the ones that doesn't use key derivation) to the new one that signs using key derivation
* | | Call get_cookie to allow the method to be overriden by subclassesSantiago Pastorino2012-11-161-1/+1
| | |
* | | Add missing env param to get_cookieSantiago Pastorino2012-11-161-1/+1
| | |
* | | Refactor url methods a bitCarlos Antonio da Silva2012-11-161-9/+9
| | | | | | | | | | | | | | | | | | Use if..else conditions instead of return guards. Use _ for not used arguments when iterating. Set the path variable directly instead of using an empty string and <<.
* | | Merge pull request #8112 from rails/encrypted_cookiesSantiago Pastorino2012-11-153-34/+99
|\ \ \ | | | | | | | | Encrypted cookies
| * | | Disallow ability to use EncryptedCookieJar with DummyKeyGeneratorSantiago Pastorino2012-11-031-0/+5
| | | | | | | | | | | | | | | | | | | | Developers must set config.secret_key_base in config/initializers/secret_token.rb
| * | | Rename secret_token_key to secret_key_baseSantiago Pastorino2012-11-031-3/+3
| | | |
| * | | Move ensure_secret_secure to DummyKeyGeneratorSantiago Pastorino2012-11-031-24/+0
| | | |
| * | | Allow users to change the default salt if they want, shouldn't be necessarySantiago Pastorino2012-11-032-11/+26
| | | |
| * | | Add encrypted cookie storeSantiago Pastorino2012-11-031-3/+20
| | | |
| * | | Add cookie.encrypted which returns an EncryptedCookieJarSantiago Pastorino2012-11-031-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How to use it? cookies.encrypted[:discount] = 45 => Set-Cookie: discount=ZS9ZZ1R4cG1pcUJ1bm80anhQang3dz09LS1mbDZDSU5scGdOT3ltQ2dTdlhSdWpRPT0%3D--ab54663c9f4e3bc340c790d6d2b71e92f5b60315; path=/ cookies.encrypted[:discount] => 45
| * | | Sign cookies using key deriverSantiago Pastorino2012-11-031-15/+19
| | |/ | |/|
* | | Use get in the redirection doc examplesCarlos Antonio da Silva2012-11-091-7/+7
| | | | | | | | | | | | | | | | | | | | | get is the most common usage, and match without an explicit verb was disallowed in 56cdc81c08b1847c5c1f699810a8c3b9ac3715a6. [ci skip]
* | | Deprecate Hash#diff.Steve Klabnik2012-11-091-3/+1
| | | | | | | | | | | | | | | | | | It's no longer used in Rails any more. See https://github.com/rails/rails/pull/8142\#issuecomment-10227297 for more
* | | implement to_a and to_ary so that the Array() call in template.rb willAaron Patterson2012-11-091-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not raise so many exceptions: https://github.com/rails/rails/blob/master/actionpack/lib/action_view/template.rb#L126 irb(main):001:0> class Foo; def method_missing(*args); super; end end => nil irb(main):002:0> $DEBUG = true => true irb(main):003:0> Array(Foo.new) Exception `NoMethodError' at (irb):1 - undefined method `to_ary' for #<Foo:0x007f854390e488> Exception `NoMethodError' at (irb):1 - undefined method `to_a' for #<Foo:0x007f854390e488> => [#<Foo:0x007f854390e488>] irb(main):004:0>
* | | Revert "Merge pull request #8017 from jcoglan/objectless_sessions"Jon Leighton2012-11-091-24/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 36376560fdd02f955ae3bf6b7792b784443660ad, reversing changes made to 3148ed9a4bb7efef30b846dc945d73ceebcc3f0f. Conflicts: actionpack/lib/action_dispatch/middleware/flash.rb Reason: it broke Sam's CI https://github.com/rails/rails/pull/8017#issuecomment-10210655
* | | Remove free usage of #tapCarlos Antonio da Silva2012-11-081-3/+4
| | |
* | | Merge pull request #8017 from jcoglan/objectless_sessionsJon Leighton2012-11-081-9/+23
|\ \ \ | | | | | | | | Store FlashHashes in the session as plain hashes
| * | | Store FlashHashes in the session as plain hashes rather than custom objects ↵James Coglan2012-11-031-9/+23
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with unstable class names and instance variables. Refactor FlashHash to take values for its ivars in the constructor, to pretty up FlashHash.from_session_value. Remove stale comment on FlashHash: it is no longer Marshaled in the session so we can change its implementation. Remove blank lines I introduced in controller/test_case.rb. Unit tests for FlashHash#to_session_value. Put in a compatibility layer to accept FlashHash serializations from Rails 3.0+. Test that Rails 3.2 session flashes are correctly converted to the new format. Remove code path for processing Rails 3.0 FlashHashes since they can no longer deserialize.
* | | Merge pull request #8115 from senny/7842_handle_trailing_slash_with_enginesRafael Mendonça França2012-11-081-3/+1
|\ \ \ | | | | | | | | handle trailing slash with engines (test case for #7842)
| * | | routing prefix slash replacement is no longer necessaryYves Senn2012-11-041-3/+1
| |/ /
* / / Add ensure block to make sure the state is properly restoredCarlos Antonio da Silva2012-11-041-1/+1
|/ /
* / Clear url helpers when reloading routesSantiago Pastorino2012-11-021-0/+1
|/
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-0318-169/+169
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * 1.9 hash syntax changes to docsAvnerCohen2012-10-3118-169/+169
| |
* | Revert "Merge pull request #7668 from Draiken/fix_issue_6497"Rafael Mendonça França2012-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f4ad0ebe7a6b17658bddfeb996e3c34835b75623, reversing changes made to 8b2cbb3a832101f0e672ee309beca0f8c555b292. Conflicts: actionpack/CHANGELOG.md REASON: This added introduced a bug when you have a shorthand route inside a nested namespace. See https://github.com/rafaelfranca/rails/commit/281367eb770faf8077c1fd6194188e92ed1637a1
* | memoize calculated ip without additional variableSergey Nartimov2012-11-011-6/+4
| | | | | | | | There is no need in additional `@calculated_ip` instance variable.
* | Fix #8086 (BestStandardsSupport rewrites app X-UA-Compatible header, now ↵Nikita Afanasenko2012-11-011-1/+7
| | | | | | | | | | | | | | appends). Now `BestStandardsSupport` middleware appends it's `X-UA-Compatible` value to app's value. Also test for `BestStandardsSupport` middleware added.
* | Revert "if format is unknown NullMimeTypeObject is returned"Guillermo Iguaran2012-10-311-12/+1
| | | | | | | | This reverts commit a8560fa361958b33d76e4468eb5c07d82a20196e.
* | if format is unknown NullMimeTypeObject is returnedAngelo capilleri2012-10-311-1/+12
| | | | | | | | | | | | | | | | | | | | If a unknown format is passed in a request, the methods html?, xml?, json? ...etc Nil Exception. This patch add a class NullMimeTypeObject, that is returned when request.format is unknown and it responds false to the methods that ends with '?'. It refers to #7837, not fixes because it's not considered a improvement not a bug.
* | Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-302-4/+3
| |
* | Provide a call stack for deprecation warnings where needed.Nikita Afanasenko2012-10-291-2/+2
| | | | | | | | It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.