aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | Let TestResponse assign a parser.Kasper Timm Hansen2016-07-104-57/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we'd only assign a response parser when a request came through Action Dispatch integration tests. This made calls to `parsed_body` when a TestResponse was manually instantiated — though own doing or perhaps from a framework — unintentionally blow up because no parser was set at that time. The response can lookup a parser entirely through its own ivars. Extract request encoder to its own file and assume that a viable content type is present at TestResponse instantiation. Since the default response parser is a no-op, making `parsed_body` equal to `body`, no exceptions will be thrown.
* | | | | | | | removes a unnecessary limit callXavier Noria2016-07-131-1/+0
| |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | We are setting a limit unconditionally just below, which overrides any existing one anyway.
* | | | | | | adds support for limits in batch processingXavier Noria2016-07-134-54/+220
| |/ / / / / |/| | | | |
* | | | | | Merge pull request #25799 from greysteil/wrap-rack-params-exceptionsMatthew Draper2016-07-143-2/+14
|\ \ \ \ \ \ | | | | | | | | | | | | | | Handle `Rack::QueryParser` errors in `ActionDispatch::ExceptionWrapper`
| * | | | | | Handle `Rack::QueryParser` errors in `ActionDispatch::ExceptionWrapper`Grey Baker2016-07-123-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rack [recently](https://github.com/rack/rack/commit/7e7a3890449b5cf5b86929c79373506e5f1909fb) moved the namespace of its `ParameterTypeError` and `InvalidParameterError` errors. Whilst an alias for the old name was added, the logic in `ActionDispatch::ExceptionWrapper` was still broken by this change, since it relies on the class name. This PR updates `ActionDispatch::ExceptionWrapper` to handle the Rack 2.0 namespaced errors correctly. We no longer need to worry about the old names, since Rails specifies Rack ~> 2.0.
* | | | | | | Merge pull request #25795 from mechanicles/command-importanceGuillermo Iguaran2016-07-132-2/+2
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | Give importance to rails command [ci skip]
| * | | | | | Give importance to rails command in the comment section.Santosh Wadghule2016-07-132-2/+2
| | |/ / / / | |/| | | |
* | | | | | Merge pull request #25748 from CodingItWrong/generator-field-types-linkVipul A M2016-07-131-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Correct link for model generator field types
| * | | | | | Correct link for model generator field typesJosh Justice2016-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most complete list of field types appears in the `SchemaStatements` docs rather than the `TableDefinition` docs. The change to link to `SchemaStatements` means that the explanation for the `index` parameter is no longer available on the linked-to page. A brief explanation of the `index` parameter is added directly in the guide to make up for this.
* | | | | | | Merge pull request #25790 from mrageh/wrap-lazy-load-hooks-in-moduleRafael França2016-07-131-18/+26
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | Wrap module around lazy load hooks
| * | | | | | Wrap module around lazy load hooksmrageh2016-07-121-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for issue https://github.com/rails/rails/issues/25784 Prior to this commit the lazy_load_hooks.rb file contained important lazy load hooks. Since [7c90d91](https://github.com/rails/rails/commit/7c90d91c3c43bdbba25d38589aed0e2940af3bc8) the [documentation](http://api.rubyonrails.org/files/activesupport/lib/active_support/lazy_load_hooks_rb.html) did not display the comments in this file as the docs for load hooks. This commit wraps the code within this file in a module so we can display the documentation for `ActiveSupport` load hooks. By extending `ActiveSupport` with this module, all the methods within it should still be accessible through `ActiveSupport`.
* | | | | | | Remove old test that check duplicated items in the load pathRafael Mendonça França2016-07-131-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test was added to protect the test suite from our mistakes but now it is failing because bundler does add duplicated libs in the load path by design (if the repository has more than one gem)
* | | | | | | Missing require 'active_support/multibyte/unicode'Akira Matsuda2016-07-121-0/+1
| | | | | | |
* | | | | | | Merge pull request #25797 from kei-s/migrations_linksVipul A M2016-07-124-7/+7
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | [ci skip] Update redirecting links in guides
| * | | | | | [ci skip] Update redirecting links in guideskei-s2016-07-124-7/+7
|/ / / / / /
* | | | | | Merge pull request #25690 from robin850/speed-up-rdocXavier Noria2016-07-121-0/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | Speed up RDoc generation when it's already been done once
| * | | | | | Speed up RDoc generation when it's already been done onceRobin Dupret2016-07-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only include files that contain changes since the last generation of the API documentation. Thus, only modified files are re-generated instead of the whole API. The `created.rid` file won't contain the whole list of files anymore if we generate several times the API but we don't really care about it, only the generation date and time is important. It is possible to fall back to the previous behavior by defining the ALL environment variable running the `rake rdoc` task.
* | | | | | | Merge pull request #25794 from mechanicles/rails-to-RailsRafael França2016-07-128-10/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | rails -> Rails [ci skip]
| * | | | | | | rails -> Rails [ci skip]Santosh Wadghule2016-07-128-10/+10
| | |_|_|/ / / | |/| | | | |
* | | | | | | Merge pull request #25793 from jmondo/strptimeRafael França2016-07-123-0/+17
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Raise ArgumentError for bad strptime arguments
| * | | | | | | Raise ArgumentError for bad strptime argumentsJohn Gesimondo2016-07-113-0/+17
|/ / / / / / /
* | | | | | | Merge pull request #25792 from prathamesh-sonpatki/test-typoMatthew Draper2016-07-122-6/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Remove duplicate test and fix a typo in the test
| * | | | | | | Remove duplicate test and fix a typo in the testPrathamesh Sonpatki2016-07-122-6/+1
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Tests for dup'ing params was separately added in a separate file in https://github.com/rails/rails/pull/25735.
* | | | | | | Merge pull request #25735 from timrogers/actioncontroller-parameters-dupMatthew Draper2016-07-122-14/+48
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | Stop changes to a dupped `ActionController::Parameters` mutating the original
| * | | | | | Trust `Object#dup` in `ActionController::Parameters`, using ↵Tim Rogers2016-07-082-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `#initialize_copy` to manually duplicate the underlying parameters hash It looks like `ActionController::Parameters#dup` is leftover from when the class inherited from `Hash`. We can just trust `#dup`, which already copies the `@permitted` instance variable (confirmed by tests). We still define a `#initialize_copy` to make `@parameters` a copy that can be mutated without affecting the original instance.
| * | | | | | Changes to a dupped `ActionController::Parameters` mutate the originalTim Rogers2016-07-072-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `ActionController::Parameters` is duplicated with `#dup`, it doesn't create a duplicate of the instance variables (e.g. `@parameters`) but rather maintains the reference (see <http://ruby-doc.org/core-2.3.1/Object.html>). Given that the parameters object is often manipulated as if it were a hash (e.g. with `#delete` and similar methods), this leads to unexpected behaviour, like the following: ``` params = ActionController::Parameters.new(foo: "bar") duplicated_params = params.dup duplicated_params.delete(:foo) params == duplicated_params ``` This fixes the bug by defining a private `#initialize_copy` method, used internally by `#dup`, which makes a copy of `@parameters`.
* | | | | | | AS::Duration should serialize empty values correctly. (#25656)Paul Sadauskas2016-07-112-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation serializes zero-length durations incorrectly (it serializes as `"-P"`), and cannot un-serialize itself: ``` [1] pry(main)> ActiveSupport::Duration.parse(0.minutes.iso8601) ActiveSupport::Duration::ISO8601Parser::ParsingError: Invalid ISO 8601 duration: "-P" is empty duration from /Users/rando/.gem/ruby/2.3.1/gems/activesupport-5.0.0/lib/active_support/duration/iso8601_parser.rb:96:in `raise_parsing_error' ``` Postgres empty intervals are serialized as `"PT0S"`, which is also parseable by the Duration deserializer, so I've modified the `ISO8601Serializer` to do the same. Additionally, the `#normalize` function returned a negative sign if `parts` was blank (all zero). Even though this fix does not rely on the sign, I've gone ahead and corrected that, too, in case a future refactoring of `#serialize` uses it.
* | | | | | | Merge pull request #25782 from kamipo/fix_test_failureRafael França2016-07-111-3/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix Active Record test failure
| * | | | | | | Fix Active Record test failureRyuta Kamizono2016-07-121-3/+2
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | Caused at a45363a2fb53e0a016f33dd211c00b5d81764379.
* | | | | | | Merge pull request #25575 from ↵Sean Griffin2016-07-111-2/+13
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | taboularasa/taboularasa/update-docs-ActiveModel__Type__Boolean [ci skip] add class level documentation to ActiveModel::Type::Boolean
| * | | | | | | [ci skip] add class level documentation to ActiveModel::Type::BooleanDavid Elliott2016-07-111-2/+13
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | add documentation of the behaviors of type coercion at the class level
* / | | | | | Always prefer class types to query types when casting `group`Sean Griffin2016-07-114-6/+23
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `group` is used in combination with any calculation method, the resulting hash uses the grouping expression as the key. Currently we're incorrectly always favoring the type reported by the query, instead of the type known by the class. This causes differing behavior depending on whether the adaptor actually gives proper types with the query or not. After this change, the behavior will be the same on all adaptors -- we see if we know the type from the class, fall back to the type from the query, and finally fall back to the identity type. Fixes #25595
* | | | | | Merge pull request #25773 from jmondo/patch-2प्रथमेश Sonpatki2016-07-111-1/+1
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Update class_attribute docs
| * | | | | Update class_attribute docsJohn Gesimondo2016-07-101-1/+1
|/ / / / /
* | | | | Merge pull request #25757 from monkey-mas/add-tests-for-response_testGuillermo Iguaran2016-07-101-0/+20
|\ \ \ \ \ | | | | | | | | | | | | Add tests for 1xx, 204 and 304 responses to response_test.rb
| * | | | | Add tests for 1xx, 204 and 304 responses to response_test.rbMasaru Nomura2016-07-091-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In response_test.rb, we haven't had a test to make sure that 1) these responses don't have a message-body as described in RFC7231[1] 2) 1xx and 204 responses must not have a Content-Length header field as described in RFC7230-section3.3.2[2] [1] https://tools.ietf.org/html/rfc7231 [2] https://tools.ietf.org/html/rfc7230#section-3.3.2 Even though our implementation doesn't allow users to send a Content-Length header field in a 304 response, sending the header field is valid as mentioned in RFC7230-section3.3.2[2]. So I've decided not to test whether or not a 304 response has the header. The citation from the section is as follows; ``` A server MAY send a Content-Length header field in a 304 (Not Modified) response to a conditional GET request (Section 4.1 of [RFC7232]); a server MUST NOT send Content-Length in such a response unless its field-value equals the decimal number of octets that would have been sent in the payload body of a 200 (OK) response to the same request. ```
* | | | | | Merge pull request #25769 from y-yagi/remove_unnecessary_sendGuillermo Iguaran2016-07-101-5/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | remove unnecessary send
| * | | | | | remove unnecessary sendyuuji.yaginuma2016-07-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `class_variable_get` is public from Ruby 1.9. Ref: http://ruby-doc.org/core-2.2.0/Module.html#method-i-class_variable_get
* | | | | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2016-07-103-3/+18
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | Fix documentation for number_with_precision helper in AV guide [ci skip]Prathamesh Sonpatki2016-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - It accepts `precision` option, not `number_with_precision`.
| * | | | | | Expand on Instance variables section with an example and specify when the ↵Vipul A M2016-07-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | instance variables are set.[ci skip]
| * | | | | | Fix number_with_precision documentation for precision [ci skip]Vipul A M2016-07-021-1/+1
| | | | | | |
| * | | | | | Expand on #24071 for specifying custom locale fallbacks. [ci skip]Vipul A M2016-06-291-1/+3
| | | | | | |
* | | | | | | Merge pull request #25759 from prathamesh-sonpatki/changelog-cleanupsRafael França2016-07-092-8/+12
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Cleanup CHANGELOGs [ci skip]
| * | | | | | | Cleanup CHANGELOGs [ci skip]Prathamesh Sonpatki2016-07-092-8/+12
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Cleanup Active Record CHANGELOG. - Add missing CHANGELOG for https://github.com/rails/rails/pull/25688. - Clarify that assets requests logging is suppressed.
* | | | | | | Merge pull request #25766 from vipulnsward/fix-ac-tests-2-4Rafael França2016-07-091-1/+1
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Fix AJ tests on ruby 2.4 being caused since classes are unified for Integer
| * | | | | | Fix AJ tests on ruby 2.4 being causes since classes are unified for Integer, ↵Vipul A M2016-07-091-1/+1
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | and we create test name nased on arg class. Append ar as well to the test name
* | | | | | Merge pull request #23636 from rab/fix-to_param-truncationMatthew Draper2016-07-093-4/+41
|\ \ \ \ \ \ | | | | | | | | | | | | | | fix to_param to maximize content
| * | | | | | fix to_param to maximize contentRob Biedenharn2016-07-083-4/+41
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation states that parameter values longer than 20 characters will be truncated by words, but the example shows that a parameter based on "David Heinemeier Hansson" (with id: 125) becomes "125-david" when "David Heinemeier".length == 16 so why so short? The answer lies in the use of the #truncate option omission: nil which seems to have been intended to mean "nothing", but which actually causes the default string "..." to be used. This causes #truncate to cleave words until the "..." can be added and still remain within the requested size of 20 characters. The better option is omission: '' (which is probably what was originally intended). Furthermore, since the use of #parameterize will remove non-alphanumeric characters, we can maximize the useful content of the output by calling parameterize first and then giving truncate a separator: /-/ rather than a space.
* | | | | | Merge pull request #25652 from prathamesh-sonpatki/rm-boot-railsGuillermo Iguaran2016-07-0838-46/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove unused boot_rails method and it's usage