Commit Graph

59396 Commits

Author SHA1 Message Date
Aaron Patterson 6949f8e5e7 Merge pull request #26317 from maclover7/jm-fix-26298
Allow `send_file` to declare a charset
2016-08-29 15:23:04 -07:00
Jon Moss 92f8b99ff7 Remove default argument, and extract internal convenience method 2016-08-29 18:00:45 -04:00
Jon Moss bed91f8421 Add regression tests 2016-08-29 17:54:02 -04:00
Jon Moss a960fc7032 Allow `send_file` to declare a charset
Removed my patch in favor of @tenderlove's less invasive approach.

[Aaron Patterson & Jon Moss]
2016-08-29 17:50:48 -04:00
Andrew White 3fc414a019 Merge pull request #26318 from alexcameron89/contributing-doc-update
[ci skip] Update branch version in Contributing Guide
2016-08-29 17:12:16 +01:00
Alex Kitchens a84b50374e [ci skip] Update branch version in Contributing Guide
Since only Rails 4 and above are currently supported, this updates a
3-2-stable example to be consistent with the support standard.
2016-08-29 11:00:43 -05:00
Ryo Hashimoto 2ea66fc6c5 Fix nested multiple roots
The PR #20940 enabled the use of multiple roots with different constraints
at the top level but unfortunately didn't work when those roots were inside
a namespace and also broke the use of root inside a namespace after a top
level root was defined because the check for the existence of the named route
used the global :root name and not the namespaced name.

This is fixed by using the name_for_action method to expand the :root name to
the full namespaced name. We can pass nil for the second argument as we're not
dealing with resource definitions so don't need to handle the cases for edit
and new routes.

Fixes #26148.
2016-08-29 16:24:51 +01:00
Rafael Mendonça França 60f34fd7ef
Remove unneeded FIXME note
This is the intended behavior. You should not do more than one request
in a controller test.
2016-08-29 11:04:15 -03:00
Kasper Timm Hansen eab8c3b9c2 Merge pull request #26311 from y-yagi/use_inspect_for_show_value
use `inspect` for show `from` value
2016-08-29 08:13:55 +02:00
Jon Moss 8d251029ce Merge pull request #26310 from kjellberg/guides
Add .gitignore to "files & purpose" list - getting started docs
2016-08-28 21:07:04 -04:00
Rasmus Kjellberg 7425aaaec3 Added gitignore to "files & purpose" list [ci skip] 2016-08-29 02:53:55 +02:00
yuuji.yaginuma 6582c7c54a use `inspect` for show `from` value
If `from` is nil, in order to avoid the blank is showed.
2016-08-29 09:06:10 +09:00
Kasper Timm Hansen 9aa6a75eef Merge pull request #26305 from kamipo/follow-up-to-26301
Switch back to `Hash.dup`
2016-08-28 09:02:29 +02:00
Kasper Timm Hansen 7a65dc6fe3 Merge pull request #26306 from kamipo/remove_under_ruby-1.9
Remove "Under Ruby 1.9" [ci skip]
2016-08-28 08:53:35 +02:00
Ryuta Kamizono 73b8823a93 Remove "Under Ruby 1.9" [ci skip]
Rails dropped Ruby 1.9 support, but this comment still true.
2016-08-28 15:40:12 +09:00
Ryuta Kamizono d64732ec7c Switch back to `Hash.dup`
Follow up to #26301.
2016-08-28 15:15:46 +09:00
Guillermo Iguaran cec60d3989 validate_each in NumericalityValidator is never called in this case.
NumericalityValidator#validate_each is never called when allow_nil is true and
the value is nil because it is already skipped in EachValidator#validate.
2016-08-28 00:37:10 -05:00
Nicolai Reuschling 43f1b23a75 Add test for allow_blank in numericality validation
Signed-off-by: Guillermo Iguaran <guilleiguaran@gmail.com>
2016-08-28 00:29:40 -05:00
Guillermo Iguaran f3f8589f77 Merge pull request #26301 from maclover7/jm-fix-comment
Switch back to `Hash.dup`
2016-08-27 23:22:14 -05:00
Jon Moss 79a2d07851 Switch back to `Hash.dup`
The performance difference between `Hash[]` and `Hash.dup` looks to have
been narrowed by @tenderlove via this commit --> b3803cc49a (diff-eff9999082c8ce7d8ba1fc1d79f439cf).
Since this commit first appeared in Ruby 2.0.0, and since Rails now
requires a minimum Ruby version of 2.2.2, this performance boost should
be available for all users.

Relevant links:

- This behavior was originally added via 02174a3efc
- The conversation on the Ruby issue tracker lives here --> https://bugs.ruby-lang.org/issues/7166
2016-08-27 19:06:04 -04:00
Vipul A M a63de6db43 Merge pull request #26299 from davydovanton/fix-typo
Fix typo in Delegation#delegate_missing_to doc [ci skip]
2016-08-27 17:21:36 +05:30
Anton Davydov aa595909bf Fix typo in Delegation#delegate_missing_to doc [skip ci] 2016-08-27 14:47:17 +03:00
Vijay Dev 187aad6a7a Merge pull request #26297 from ledermann/patch-1
Errors#add_on_blank: Fix typo in deprecation message
2016-08-27 16:13:07 +05:30
Georg Ledermann 11f5434a8c Fix typo in deprecation message
This fixes a copy-and-paste-issue slipped in by #18996
2016-08-27 08:42:45 +02:00
Guillermo Iguaran 29f097c538 Merge pull request #26293 from mechanicles/move-custom-assertion
Move Rails' custom assertion method `assert_nothing_raised` to its proper place.
2016-08-27 01:08:43 -05:00
Santosh Wadghule 3cece0b657 Move custom assertion to its proper place
ActiveSupport::Testing::Assertions.

We have a separate module in which have defined Rails' own custom
assertions. So it would be good to keep all custom Rails' assertions in
one place i.e. in this module.
2016-08-27 08:33:08 +05:30
eileencodes 1ec85cf9d8 Missing key should throw KeyError
It should not throw a NameError, but should throw a KeyError.

Fixes #26278
2016-08-26 13:12:33 -04:00
Guillermo Iguaran f394f3ba76 Merge pull request #26288 from maclover7/jm-revert-21995
Update `Rails.configuration` documentation
2016-08-26 09:30:34 -05:00
Jon Moss 2f5a40a800 Clarify two ways to set Rails configuration options
[ci skip]
2016-08-26 10:24:38 -04:00
Jon Moss 01dca5b4b3 Add back in `config_for` example
[ci skip]
2016-08-26 10:20:18 -04:00
Jon Moss 5fb513f26a Revert "Merge pull request #21995 from tak1n/master"
This reverts commit 4973704bf5, reversing
changes made to 78edeb3334.
2016-08-26 10:15:01 -04:00
Jon Moss c8c8af9c31 Merge pull request #26287 from mechanicles/rails-assertion
Move `assert_nothing_raised` method to Rails Specific Assertions section [ci skip]
2016-08-26 10:02:55 -04:00
Santosh Wadghule ba84258819 Move `assert_nothing_raised` method to Rails Specific Assertions
section [ci skip]

- Method `assert_nothing_raised` is Rails' own custom assertion method and
not a part of Minitest. So move it from Minitest assertions section to Rails
Specific Assertions section.
2016-08-26 19:05:24 +05:30
Guillermo Iguaran 56fe966e6a Merge pull request #26284 from kamipo/fix_warnig
Fix "warning: assigned but unused variable - task"
2016-08-25 21:09:53 -05:00
Ryuta Kamizono 65d71d8d42 Fix "warning: assigned but unused variable - task" 2016-08-26 06:21:40 +09:00
Rafael Mendonça França 029cbb3535
Fix typo in the hook name 2016-08-25 04:41:50 -03:00
Rafael Mendonça França 0510208dd1
Add load hooks to all tests classes
Usually users extends tests classes doing something like:

    ActionView::TestCase.include MyCustomTestHelpers

This is bad because it will load the ActionView::TestCase right aways
and this will load ActionController::Base making its on_load hooks to
execute early than it should.

One way to fix this is using the on_load hooks of the components like:

    ActiveSupport.on_load(:action_view) do
      ActionView::TestCase.include MyCustomTestHelpers
    end

The problem with this approach is that the test extension will be only
load when ActionView::Base is loaded and this may happen too late in the
test.

To fix this we are adding hooks to people extend the test classes that
will be loaded exactly when the test classes are needed.
2016-08-25 04:22:48 -03:00
Aaron Patterson 804f5b3c2a
kick different instrumentation method
We can eliminate a conditional by calling a different instrumentation
method depending on the situation.  In this case, we'll call the special
case "!render_template" instrumentation method and eliminate the case /
when clause from the `instrument` method.
2016-08-24 16:01:55 -07:00
Aaron Patterson c104940363
remove useless freeze
Ruby already does this freeze for us.
2016-08-24 15:52:40 -07:00
Aaron Patterson 07da5aebb1
Simplify cache hit logging
CacheHelper is mixed in to Helpers, Helpers is mixed in to AV::Base.
This means we can count on instances of AV::Base to have the "cache hit"
method on them, and we can stop setting an ivar for cache logging and
just ask the view if it was a cache hit.
2016-08-24 15:13:19 -07:00
Guillermo Iguaran ef8315ac78 Merge pull request #26271 from jcoleman/fix-unnecessary-query-cache-busting-test
Test that AR query cache isn't busted when types are not same object
2016-08-24 15:07:20 -05:00
Sean Griffin dd77e1bbfe Merge pull request #26235 from samphippen/allow-early-setting-of-integration-session
Allow the `integration_sesion` to be set early on ActionDispatch::Integration::Runner.
2016-08-24 12:43:19 -04:00
James Coleman 3df5173d00 Test that AR query cache isn't busted when types are not same object
This is fixed in 5.0 as an ancillary part of 574f255629
but here I also add a test for the condition.

I'd previously backported the fix (and added a test) in the below
commit; this brings the fix back up to master.

(cherry picked from commit fce3dbf302)
2016-08-24 10:09:23 -04:00
Rafael França ae570a2ead Merge pull request #26267 from riseshia/patch-1
Rename the title of comand_line.md in index
2016-08-23 23:29:44 -03:00
Rafael França 8c83a449f5 Merge pull request #26182 from bogdan/remove-relation-metaprogramming
Remove over meta programming in AR::Relation
2016-08-23 23:29:20 -03:00
Shia 53a8663bb5 Rename the title of comand_line.md in index
Remove 'rake tasks' from index
2016-08-24 11:27:00 +09:00
Rafael França 3df9876a24 Merge pull request #26258 from kamipo/remove_unnecessary_format_string
Remove unnecessary `format_string`
2016-08-23 22:36:12 -03:00
Rafael França 6119b022cf Merge pull request #26259 from riseshia/patch-1
Improve 5.0 Release notes
2016-08-23 22:34:29 -03:00
Rafael França 0d2f79b0ca Merge pull request #26265 from ipmsteven/fixwording
remove extra … in comments
2016-08-23 18:53:15 -03:00
yunlei cdd2b278dc yl - remove extra … 2016-08-23 13:08:30 -07:00