Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rails/rails
...
head fork: rails/rails
This comparison is big! We're only showing the most recent 250 commits
Commits on Jun 12, 2015
@rafaelfranca rafaelfranca Merge pull request #20529 from pwnall/kwargs_docs
Update RDoc for ActionController::TestCase for kwargs.
0965be1
@seuros seuros Merge pull request #20526 from y-yagi/fix_doc_about_foreign_key_name
fix doc about foreign key name [ci skip]
40ffcd8
@sgrif sgrif Merge pull request #19813 from igas/enum-prefix
Add prefix option to enum definition
0158f92
@senny senny Merge pull request #20226 from EpicH0liday/reversible-remove-foreign-key
Make remove_foreign_key reversible

Conflicts:
	activerecord/CHANGELOG.md
98cacae
@senny senny Merge pull request #20480 from senny/test_runner
use our own runner for Rails framework components `bin/test`
1d43458
@knovoselic knovoselic Fix for #20489 - ActiveSupport::Concern#class_methods affects parent …
…classes
f98e75a
@rafaelfranca rafaelfranca Merge pull request #20494 from knovoselic/active_support_concern_clas…
…s_methods_fix

[ActiveSupport] Fix for #20489 - ActiveSupport::Concern#class_methods affects parent classes
8beb328
@sgrif sgrif Don't crash when mutating attributes in a getter
If a getter has side effects on the DB, `changes_applied` will be called
twice. The second time will try and remove the changed attributes cache,
and will crash because it's already been unset. This also demonstrates
that we shouldn't assume that calling getters won't change the value of
`changed_attributes`, and we need to clear the cache if an attribute is
modified.

Fixes #20531.
07b4078
@tenderlove tenderlove Merge pull request #18365 from pocke/fix_datatime_compare
DateTime#<=> return nil when compare to the invalid String as Time.
04e727d
@sgrif sgrif Add a test to ensure `serialize` persists `nil` as `NULL` 65cd9f7
@dcrec1 dcrec1 add doc about how empty serialization objects are persisted
the test case for this commit is in cd3f5db
167ce08
@rafaelfranca rafaelfranca Merge pull request #20539 from dcrec1/doc
add doc about how empty serialization objects are persisted
04c3496
@rafaelfranca rafaelfranca Copy-edits in 04c3496 22e39f8
@greysteil greysteil Handle param-parsing errors from Rack in ExceptionWrapper 0a9b86b
@matthewd matthewd Merge pull request #19632 from greysteil/reorder-middleware
Handle param-parsing errors from Rack that happen low down the stack
335a2b8
Commits on Jun 13, 2015
@spark008 spark008 Add fixture use case to testing.md.
I think people would find it useful to know that you can pass in multiple fixture names to get an array of all the fixtures. I've found this useful in my own app. It looks like there already a test case that supports this feature (https://github.com/rails/rails/blob/master/activerecord/test/cases/fixtures_test.rb#L398), but it's just not documented here.

I look forward to your feedback!
3862c55
@zzak zzak Merge pull request #20543 from spark008/patch-1
Add fixture use case to testing.md.
521c51d
@senny senny let's use the latest bundler version. c0b4654
@senny senny make it possible to customize the executable inside rereun snippets.
In the Rails repository we use a `bin/test` executable to run our tests.
However the rerun snippets still included `bin/rails test`:

BEFORE:
```
Failed tests:

bin/rails test test/cases/adapters/postgresql/schema_test.rb:91
```

AFTER:
```
Failed tests:

bin/test test/cases/adapters/postgresql/schema_test.rb:91
```
2e59604
@repinel repinel [ci skip] Fix the API docs for Bi-directional associations
The examples now take in consideration when Active Record finds inverse
associations automatically.
55703f9
@zzak zzak Merge pull request #20542 from repinel/fix-bi-directional-assoc-doc
[ci skip] Fix the API docs for Bi-directional associations
dfc9269
@matthewd matthewd Revert "revises a test to account for case-insensitive file systems"
This reverts commit d345ce9.
def1450
@maurogeorge maurogeorge Add RDoc about add_reference to ActiveRecord::Migration
[ci skip]
0f194a0
@maurogeorge maurogeorge Add gotcha to RDoc of collection_check_boxes
[ci skip]
58a75ff
@tenderlove tenderlove don't hold a reference to `env` in the options object
I want to decouple Rails from the rack ENV as much as possible.  We
should try to keep as few references to the env as possible
3692ca5
@jamesdabbs jamesdabbs Fix `undefined method uncached` for polymorphic belongs_to #20426
Unitialized polymorphic `belongs_to` associations raise an error while
attempting to reload, as they attempt to make an uncached reload, but
don't have a klass to fetch uncachedly. In this case, `loaded?` should
be `false` anyway.
5a9590c
Commits on Jun 14, 2015
@yui-knk yui-knk [ci skip] Add '.' fdb3015
@yui-knk yui-knk [ci skip] Fix to Fixed-width Font
LookupContext is class name
387cc15
@jhubert jhubert [ci skip] Fix the dynamic fixtures example
My impression of the code sample is that the intent is to assign guy_1, guy_2, etc. The code as it stood would have assigned guy_1, guy_1, etc.

This simply replaces the 1 with the iterator variable i.
a5c06e1
@kaspth kaspth Merge pull request #20553 from jhubert/patch-1
[ci skip] Fix the dynamic fixtures example
34e6c5d
@kuldeepaggarwal kuldeepaggarwal [ci skip] fix typo mistake e834d46
@ZeroMax-dev ZeroMax-dev Extended 'Active Job Basics' edge guide with more detailed informatio…
…n and an additional step [ci skip]

Normalized use of 'queueing'/'queuing' in the document.
3b24aa9
@kaspth kaspth Merge pull request #20554 from kuldeepaggarwal/fix/enum_docs
[ci skip] fix typo mistake
70902cf
@zzak zzak Merge pull request #20511 from ZeroMax-dev/master
Extended 'Active Job Basics' guide with more detailed information
361014a
@zzak zzak Merge pull request #20548 from maurogeorge/collection_check_boxes-rdo…
…c-gotcha

Add gotcha to RDoc of collection_check_boxes
88cd09f
@prathamesh-sonpatki prathamesh-sonpatki Add missing "header" word in documentation of Token#authentication_r…
…equest [ci skip]
fe117ce
@mtsmfm mtsmfm ActionDispatch::SSL should keep original header's behavior
`ActionDispatch::SSL` changes headers to `Hash`.
So some headers will be broken if there are some middlewares
on ActionDispatch::SSL and if it uses `Rack::Utils::HeaderHash`.
bb0186c
@meinac meinac Wrong documentation about Rails autoload on active_jobs_basics doc [c…
…i skip]

By default Rails automaticaly loads all files under the app directory
bcf9410
@matthewd matthewd Merge pull request #20560 from vngrs/wrong_doc_of_active_job
Wrong documentation about Rails autoload on active_jobs_basics doc [ci skip]
1ad2bfc
@kaspth kaspth Merge pull request #20558 from prathamesh-sonpatki/missing-header-word
 Add missing "header" word in documentation of Token#authentication_request [ci skip]
9e9cae7
@repinel repinel Fix the message verifier encoding issue
```ruby
verifier = ActiveSupport::MessageVerifier.new('secret')
verifier.verify("\xff") # => ArgumentError: invalid byte sequence in UTF-8
```
4092f99
@guilleiguaran guilleiguaran Merge pull request #20559 from mtsmfm/fix-header-modification-by-ssl
ActionDispatch::SSL should keep original header's behavior
db62081
@8398a7 8398a7 Updated bundler link [ci skip] f7b5f6d
Commits on Jun 15, 2015
@repinel repinel [ci skip] Fix the Rails::Generators::NamedBase#template doc
Since #13612, `template` is no longer being used to generate
migrations.
5fab719
@rafaelfranca rafaelfranca Merge pull request #20562 from 8398a7/change_link_gembundler
Updated bundler link [ci skip]
58255b9
@senny senny Merge pull request #20550 from maurogeorge/add_reference-rdoc
Add RDoc about add_reference to ActiveRecord::Migration

[ci skip]
c199c6c
@senny senny quick pass over changelogs. [ci skip] 863fcfa
@senny senny make `remove_index :table, :column` reversible.
This used to raise a `IrreversibleMigration` error (since #10437).
However since `remove_index :table, :column` is probably the most basic
use-case we should make it reversible again.

Conflicts:
	activerecord/CHANGELOG.md
0e928de
@senny senny pg guide, explain the state of using UUID primary keys. Closes #20518.
[ci skip]

The PostgreSQL 9.4 docs suggest to use `pgcrypto`.
Howerver `create_table id: :uuid` will still default to `uuid_generate_v4()`
9ad3660
@robin850 robin850 A pass over the API application guide [ci skip]
* Fix a few remaining typos
* Wrap lines to 80 chars
* Fix the conversion from Textile to Markdown
* Update the part about `Rack::Cache` which isn't included anymore and
  speak about Active Support's provided middleware
* Remove references to out-of-date methods and middlewares (e.g.
  respond_with) and update the list of modules and middlewares to match
  the actual code-base.
* Remove the middleware's description and links to the Rack guide
7e30085
@repinel repinel Fix inflector test by using dup inflections when it needs to be changed
This is not something that is failing at the moment, but can do it
eventually. I had the issue with db62081 as the HEAD and with the
following change:

```
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -101,6 +101,7 @@ class InflectorTest < ActiveSupport::TestCase
   def test_acronyms
     ActiveSupport::Inflector.inflections do |inflect|
       inflect.acronym("API")
+      inflect.acronym("HTM")
       inflect.acronym("HTML")
       inflect.acronym("HTTP")
       inflect.acronym("RESTful")
```

I was expecting only `test_acronyms` to fail, but with a specific `seed`
others were also failing: `ruby -w -I"lib:test" test/inflector_test.rb
--seed 4313`.

Now, `inflections` instance is duplicated on `setup` and restored on
`teardown`.

I decided to benchmark and check the impact of the patch and it seems
to me to be fine.

```
Calculating -------------------------------------
     without changes     1.000  i/100ms
      with setup dup     1.000  i/100ms
      with block dup     1.000  i/100ms
-------------------------------------------------
     without changes      0.817  (± 0.0%) i/s -      5.000  in
     6.119916s
      with setup dup      0.784  (± 0.0%) i/s -      4.000
      with block dup      0.797  (± 0.0%) i/s -      4.000
```

Where `with setup dup` duplicates on setup for each test and `with block`
duplicates for just for tests that actually modify `inflections`.
c1a694d
@matthewd matthewd Merge pull request #20563 from repinel/fix-inflector-test
Fix inflector test by using dup inflections when it needs to be changed
ce882b1
@robin850 robin850 A few documentation edits [ci skip] a023d53
@arthurnn arthurnn Merge pull request #20016 from steved/sdavidovitz/abort_if_pending
make sure to load_config for db:abort_if_pending_migrations
feff959
@matthewd matthewd Merge pull request #20440 from repinel/fix-message-verifier-encoding-…
…issue

Fix the message verifier encoding issue
c5152dd
@arthurnn arthurnn Merge pull request #20564 from repinel/fix-generators-named-base-temp…
…late-doc

[ci skip] Fix the Rails::Generators::NamedBase#template doc
5c517ee
@arthurnn arthurnn Small refactor on db:reset
db:reset should not prematurely load the environment, so, for instance,
if there is any initializer that touches th DB, it will not touch that
before droping it.

Also this makes the code simpler.

This changed was made back in 15fb430
, not sure why. But I am pretty much sure we should do it like this, as
drop and setup should load its dependencies tasks if necessary.
68f6d53
@fxn fxn document that default_url_options is cached per request [ci skip] c865b82
@fxn fxn i18n guide: warn about default_url_options caching and locale selecto…
…rs [ci skip]
7789dfe
@kaspth kaspth Fix flakyness.
Brought on by my own stupidity :)
374b163
@matthewd matthewd Merge pull request #20573 from kaspth/fix-caching-test-for-realskies
Fix flakyness.
34b2eec
@arthurnn arthurnn Merge pull request #20107 from ankit8898/av_refac_record_tag_helper
Removed not needed includes, As record_tag_helper is moved to a gem we..
d3894b9
@arthurnn arthurnn Merge pull request #20257 from prathamesh-sonpatki/test-for-serial-fo…
…r-quoted-sequence

 Added test case for serial? method when sequence name is not quoted
c9f7350
@meinac meinac Deprecate passing hash as first parameter into ActionController::Head cf81a3b
@arthurnn arthurnn Merge pull request #20108 from akshay-vishnoi/button-tag
Add missing spec and documentation for button_tag helper
e08d8c5
@matthewd matthewd Merge pull request #20407 from vngrs/deprecate_implicit_status_for_he…
…ad_method

Deprecate passing hash as first parameter into ActionController::Head
57941f0
@tenderlove tenderlove set the default charset in response initialize
this way we don't have to mutate the instance (as much) when writing a
rack response
dd8c76d
Commits on Jun 16, 2015
@tenderlove tenderlove remove `header=` on the response object.
People should be free to mutate the header object, but not to set a new
header object.  That header object may be specific to the webserver, and
we need to hide it's internals.
50176b5
@senny senny Merge pull request #20572 from arthurnn/db_reset
Small refactor on db:reset
e60c189
@dcrec1 dcrec1 raise ActiveModel::MissingAttributeError when trying to access a rela…
…tionship without the foreign key attribute

fixes regression reported on #20253

ActiveRecord::Base#[] was not used cause of 8b95420
ba7377e
@sgrif sgrif Merge pull request #20578 from dcrec1/regression
raise ActiveModel::MissingAttributeError when trying to access a relationship without the foreign key attribute
af01f45
@rafaelfranca rafaelfranca Escape HTML entities in JSON keys
Fixes CVE-2015-3226
193b76c
@tenderlove tenderlove enforce a depth limit on XML documents
XML documents that are too deep can cause an stack overflow, which in
turn will cause a potential DoS attack.

CVE-2015-3227
9b63529
@meinac meinac Fix the comment about attr_reader of headers [ci skip] 336c196
@arthurnn arthurnn Merge pull request #20588 from vngrs/minor_comment_fix
Fix the comment about attr_reader of headers [ci skip]
62209d0
@meinac meinac Fix descriptions of databases.rake [ci skip]
revert create and drop task descriptions
0403c79
@rafaelfranca rafaelfranca Merge pull request #20587 from vngrs/fix_descriptions_of_databases_rake
Fix descriptions of databases.rake [ci skip]
56d52e3
@arthurnn arthurnn Catch InvalidURIError on bad paths on redirect.
Handle URI::InvalidURIError errors on the redirect route method, so it
wont raise a 500 if a bad path is given.
e23b314
@arthurnn arthurnn Merge pull request #20584 from arthurnn/fix_url
Catch InvalidURIError on bad paths on redirect.
0b33978
@spastorino spastorino Bump AMS to 0.10.0.rc2 16db36b
Commits on Jun 17, 2015
@meinac meinac Use single quote in Railties generators Gemfile [ci skip] 65a2ef6
@timrogers timrogers Update bundler to v1.10.4 2e42217
@kaspth kaspth Merge pull request #20596 from vngrs/use_single_quote_in_gemfile
Use single quote in Railties generators Gemfile [ci skip]
8775bc3
@rafaelfranca rafaelfranca Merge pull request #20598 from timrogers/update-bundler-version-to-1-…
…10-4

Update bundler to v1.10.4
15de4b6
@arthurnn arthurnn Revert "Merge pull request #20584 from arthurnn/fix_url"
This reverts commit 0b33978, reversing
changes made to 56d52e3.

As pointed out on the PR, this will hide development mistakes too, which
is not ideal.
ffba8f7
@tenderlove tenderlove Remove ContentLength middleware from the defaults.
ContentLength is not part of the rack SPEC since rack/rack@86ddc7a
If you want it, just add it as a middleware in your config.
5690358
@trosborn trosborn updates caching guide to reflect current Rails capabilities [ci skip] 9c1cfcb
Commits on Jun 18, 2015
@y-yagi y-yagi remove `Rails::Rack::Debugger` from guides [ci skip]
Rails::Rack::Debugger was removed in 93559da
576a83c
@zzak zzak Merge pull request #20614 from y-yagi/remove_rails_rack_debugger_from…
…_guide

remove `Rails::Rack::Debugger` from guides [ci skip]
2bf05de
@robin850 robin850 Merge pull request #20054 from trosborn/master
updates caching guide to reflect current Rails capabilities [ci skip]
3f767aa
@robin850 robin850 Tiny documentation fixes [ci skip] 068ab23
@meinac meinac fix railties tests c76b112
@eileencodes eileencodes Merge pull request #20618 from vngrs/fix_railties_tests
fix railties tests
5413c79
@prathamesh-sonpatki prathamesh-sonpatki Added documentation about passing custom disallowed types to Hash#fr…
…om_xml [ci skip]
1bc7cb2
@zzak zzak Merge pull request #20575 from prathamesh-sonpatki/doc-xml-disallowed…
…-types

 Added documentation about passing custom disallowed types to Hash#from_xml [ci skip]
8e9f57f
@dcrec1 dcrec1 assert_file understands paths with special characters
fixes #20042
6074d0f
@maurogeorge maurogeorge Add RDoc about scope option on distance_of_time_in_words
[ci skip]
f6d325e
@zzak zzak Merge pull request #20549 from maurogeorge/distance_of_time_in_words-…
…rdoc

Add RDoc about scope option on distance_of_time_in_words
dd1ac54
@rafaelfranca rafaelfranca Autoload ActiveRecord::RecordInvalid
Fixes #20626
c3133f5
@zzak zzak Nitpick :nail_care: [ci skip] 4d8abeb
@y-yagi y-yagi correct example output of references migration [ci skip]
this behavior was changed in 99a6f9e
79da980
@zzak zzak Merge pull request #20630 from y-yagi/fix_references_migration_example
correct example output of references migration [ci skip]
2702680
Commits on Jun 19, 2015
@senny senny Merge pull request #19843 from marshall-lee/explain_cte_queries
Let WITH (CTE) queries be explainable

Conflicts:
	activerecord/CHANGELOG.md
ee066af
@senny senny Merge pull request #20605 from dcrec1/assert_file
assert_file understands paths with special characters
e97b8cb
@senny senny Merge pull request #20259 from rastasheep/rastasheep-patch-1
Update documentation for ActiveRecord::Migration#remove_index
ad9290d
@senny senny Merge pull request #20117 from jfine/action-mailer-smtp-settings-update
Add openssl_verify_mode and sync other smtp_settings with API docs [ci skip]
40bdf0d
@sgrif sgrif Use `Enumerable#sum` on `ActiveRecord::Relation` when a block is given
This matches our behavior in other cases where useful enumerable methods
might have a different definition in `Relation`. Wanting to actually
enumerate over the records in this case is completely reasonable, and
wanting `.sum` is reasonable for the same reason it is on `Enumerable`
in the first place.
7d14bd3
@dcrec1 dcrec1 fix test not failing when executed isolated
the test was created in 7659fb6

the fixtures were added in c092dbe
bf192fb
@sgrif sgrif Include `Enumerable` in `ActiveRecord::Relation`
After discussing, we've decided it makes more sense to include it. We're
already forwarding every conflicting method to `to_a`, and there's no
conflation of concerns. `Enumerable` has no mutating methods, and it
just allows us to simplify the code. No existing methods will have a
change in behavior. Un-overridden Enumerable methods will simply
delegate to `each`.

[Sean Griffin & bogdan]
b644964
Commits on Jun 20, 2015
@senny senny Merge pull request #20636 from dcrec1/isolated_test
fix test not failing when executed isolated
3401224
@davetron5000 davetron5000 Override default_render's behavior with a block
In 0de4a23 the behavior when there is a missing template was changed to
not raise an error, but instead head :no_content.  This is a breaking
change and some gems rely on this happening.

To allow gems and other code to work around this, allow
`default_render` to take a block which, if provided, will
execute the contents of that block instead of doing the `head :no_content`.
6fda6c3
@fxn fxn removes unnecessary backslashes in regexps
Colons are not metacharacters.
d8c2227
@fxn fxn applies project style guidelines
Just saw these in passing while reading this file.
29959eb
Commits on Jun 21, 2015
@gaurish gaurish Remove broken links
[ci skip]
29a64f2
@ankit1910 ankit1910 Change documentation for collection.build and collection.create [ci-s…
…kip]
8f6e0b7
@repinel repinel Remove duplicate private statement fe08c81
@vijaydev vijaydev Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/configuring.md
f6797a7
@y-yagi y-yagi remove unused variable in reporter test 3bcb637
@repinel repinel Move the validations HelperMethods to its own file
Closes #11209

[Roque Pinel & Steven Yang]
bfd4e6a
Commits on Jun 22, 2015
@meinac meinac Fix the documentation about ActionController::ParameterMissing [ci skip] 2489a27
@schneems schneems Merge pull request #20654 from repinel/remove-duplicate-private
Remove duplicate private statement
0fccf64
@schneems schneems Merge pull request #20658 from vngrs/strong_parameters_parameter_wron…
…g_doc_fix

Fix the documentation about ActionController::ParameterMissing [ci skip]
7542aa8
@schneems schneems Merge pull request #20655 from y-yagi/remove_unused_variable
remove unused variable in reporter test
9dbe3f9
@meinac meinac Fix the documentation about ActionController::UnpermittedParameters […
…ci skip]
9f62180
@senny senny Merge pull request #20659 from vngrs/strong_parameters_unpermitted_pa…
…rameters_wrong_doc_fix

Fix the documentation about ActionController::UnpermittedParameters [ci skip]
8bf60b0
@senny senny Merge pull request #20656 from repinel/move-validations-helper-methods
Move the validations HelperMethods to its own file
73aa663
@senny senny AR absence validator respects `marked_for_destruction?`. Closes #20449.
Associated objects that were marked for destruction are considered absent.
30c9aa7
@senny senny docs, update Active Model reference for AR length validator. [ci skip] 792de3f
@senny senny refactor, don't duplicate presence validator logic.
This is a small refactoring that simplifies the Active Record specific
lenght validator.
006a4d7
@senny senny docs, :scissors: wrongly placed heading. [ci skip]
The heading "Active Model Length Validator" was shown on the
"ActiveModel::Validations" page without any text following it.
ebc4c60
@gmalette gmalette Allow filtering params based on parent keys
Add the possibility to only filter parameters based on
their full path instead of relying on the immediate key.

    config.filter_parameters += ['credit_card.code']

    { 'credit_card' => { 'code' => '[FILTERED]' },
      'source' => { 'code' => '<%= puts 5 %>' } }
33b9317
@dcrec1 dcrec1 thrown ActiveRecord::AssociationTypeMismatch when assigning a wrong v…
…alue for a namespaced association

fixes #20541
828d0d7
@meinac meinac Remove mistaken end from controller_path doc [ci skip] b835c72
@andreynering andreynering Minor fixes [ci skip] 35bbeab
@rafaelfranca rafaelfranca Merge pull request #20663 from andreynering/patch-1
Minor fixes [ci skip]
d8458df
@meinac meinac Add nodoc to the Validations::Helpers [ci skip] 5b36015
@rafaelfranca rafaelfranca Merge pull request #20665 from vngrs/add_nodoc_to_validations_helpers
Add nodoc to the Validations::Helpers [ci skip]
ccdefa0
@dubek dubek Improve detection of partial templates eligible for collection caching.
The regular expression which was used to detect partial templates that
begin with a `<% cache ... do %>` call missed some cases.  This commits
attempts to improve the detection for some cases such as multi-line
comments at the beginning of the template.  The different templates are
listed in two new unit test methods.

Note that specially crafted Ruby code can still evade such `cache`-call
detection: for example, a user might have its own method which itself
calls the Rails `cache` helper. In such a case, the template's code
doesn't start with a literal `cache` string and therefore will not be
eligible for collection caching.
d51e2ee
@rafaelfranca rafaelfranca Merge pull request #19431 from hmarr/head-routing
Respect routing precedence for HEAD requests
75b63de
@claudiob claudiob Merge pull request #20664 from vngrs/remove_mistaken_end_from_doc
Remove mistaken end from controller_path doc [ci skip]
7814d80
@y-yagi y-yagi do not show "Failed tests" message when a failed test is not 1d3e0f5
@rafaelfranca rafaelfranca Merge pull request #20667 from y-yagi/do_not_show_failed_messages
do not show "Failed tests" message when a failed test is not
f7ac57e
Commits on Jun 23, 2015
@senny senny Merge pull request #20545 from dcrec1/20541
thrown ActiveRecord::AssociationTypeMismatch when assigning a wrong value for a namespaced association
8e27fd9
@senny senny Merge pull request #20552 from jamesdabbs/belongs-to-polymorphic-forc…
…e-reload

Fix `undefined method uncached` for polymorphic belongs_to #20426
5e75f51
@aditya-kapoor aditya-kapoor [ci skip] correct for ActiveRecord::Associations::Preloader: c5c0ace
@senny senny docs, add missing closing bracket. [ci skip] 352b18d
@senny senny Merge pull request #20673 from aditya-kapoor/correct-preload-doc
[ci skip] correct for ActiveRecord::Associations::Preloader
de0a2a4
@robin850 robin850 Remove the paragraph about Rails::Server#middleware
As of 5690358, the Rack::ContentLength middleware isn't included by
default anymore.

The only remaining middleware is Rack::Lock ; since it's only included
when using WEBrick, it's certainly not worth documenting it in the
guides.

[ci skip]
707144a
@yui-knk yui-knk [ci skip] Make clear what `this method` is
In this sentence, there are three candidates of `this method`

* default_url_options
* url_for
* helper method(s)

so make it clear.
7a74d81
@robin850 robin850 A few documentation fixes [ci skip] e09129c
@rafaelfranca rafaelfranca Merge pull request #20674 from yui-knk/fix/guide2
[ci skip] Make clear what `this method` is
1022796
@cmtonkinson cmtonkinson More granular console SQL coloration
This new coloration approach makes it easier to scan the rails console
for specific types of activity with more fine-grained visual cues.

Virtual terminal ANSI color escape codes are used when displaying SQL
statements in the rails console. The former implementation alternates
line prefix information (including the statement name and execution
latency) between CYAN and MAGENTA. This visually differentiates any SQL
statements in the log and is useful for quickly scanning for database
activity.

While a great idea and a solid foundation, alternating between just two
colors on an even/odd basis (much like striping an HTML table) can be
improved upon.

This patch replaces the even/odd striping with a more comprehensive
scheme that applies coloration based on the type of statement being
run. Every statement logged has its prefix (name and latency) colored
white (as the statement body was previously). The statement body is now
colored according to the nature of the statement:

  - INSERT statements are GREEN (symbolic of creation or genesis)
  - SELECT statements are BLUE (typically used for informational
    displays, as SELECT statements do not normally have side-effects)
  - DELETE statements are RED (commonly used to indicate the danger of
    a destructive action)
  - UPDATE statements are YELLOW (it's like a less extreme RED :P)
  - TRANSACTION statements are CYAN (arbitrary)
  - and any other statements are MAGENTA (again, arbitrary)
f5d8dd6
@jmondo jmondo Display decimal defaults as strings to keep precision 4f58c50
Commits on Jun 24, 2015
@ivantsepp ivantsepp Update rails_welcome.png
[ci skip]
5b1b68b
@rafaelfranca rafaelfranca Merge pull request #20681 from ivantsepp/update_rails_welcome_png
Update rails_welcome.png
204c45e
Commits on Jun 25, 2015
@y-yagi y-yagi remove nonexistent hook from instrumentation guide [ci skip] 4e0c39f
@5t111111 5t111111 modify add_source in application template to take a block for gem ent…
…ries
ce3d2fa
@5t111111 5t111111 cherry-pick test and source doc from #20050 e6be33f
@senny senny Merge pull request #20696 from y-yagi/remove_active_resource_from_ins…
…trumentation_guide

remove nonexistent hook from instrumentation guide [ci skip]
41568f8
@meinac meinac Add table name prefix and suffix support to add_foreign_key and remov…
…e_foreign_key methods

fix tests
c26b914
@dhh dhh Add pending test for the great-grandparent touching bug from #19324 5f5e6d9
@guilleiguaran guilleiguaran Merge pull request #20697 from 5t111111/add-block-to-add_source
add_source in Application Template should take a block for gem entries
8cc01e0
@tenderlove tenderlove remove bad test. 17439e3
Commits on Jun 26, 2015
@sgrif sgrif Merge pull request #20677 from jmondo/decimal-default-string
Display decimal defaults as strings to keep precision
0bee410
@sikachu sikachu Add reversible syntax for change_column_default
Passing `:from` and `:to` to `change_column_default` makes this command
reversible as user has defined its previous state.

So, instead of having the migration command as:

    change_column_default(:posts, :state, "draft")

They can write it as:

    change_column_default(:posts, :state, from: nil, to: "draft")
a412872
@sikachu sikachu Update guide for new change_column_default syntax f9c8419
@sikachu sikachu Update .pluck documentation on uniq
This is to show users that they can chain `.uniq` and `.pluck` to get
the `DISTINCT column` result. They don't have to do `DISTINCT column`
themselves.
03f35fc
@zzak zzak Merge pull request #20708 from sikachu/update-pluck-suggestion
Update .pluck documentation on uniq
4b4075b
@kaspth kaspth Merge pull request #20417 from dubek/fix-template-cache-call-pattern
Improve detection of partial templates eligible for collection caching.
f999680
@fenec fenec Change routes.rb look in getting started [ci skip] e7de3e4
Commits on Jun 27, 2015
@y-yagi y-yagi correct `file_fixture_path` in plugins `test_helper.rb`
`fixture_path` does not end with a slash
5469d9e
@rafaelfranca rafaelfranca Merge pull request #20714 from y-yagi/fix_file_fixture_path
correct `file_fixture_path` in plugins `test_helper.rb`
79fc70f
@rafaelfranca rafaelfranca Merge pull request #20711 from fenec/fix_routes_in_guides
Change routes.rb look in getting started
e6035d1
@rafaelfranca rafaelfranca Merge pull request #20018 from sikachu/change-column-default-recorder
Add reversible syntax for change_column_default
859c8c3
@rafaelfranca rafaelfranca Merge pull request #20699 from vngrs/foreign_key_with_table_name_suff…
…ix_and_prefix

Add table name prefix and suffix support for foreign keys
9f94f73
@rafaelfranca rafaelfranca Merge pull request #20607 from cmtonkinson/update-console-colors
More granular console SQL coloration
261a8e1
@nhodges nhodges Remove `config` options from `default_options` in `railties`
Fixes #20345.
4dbacf2
@zzak zzak Merge pull request #20652 from ankit1910/change_doc
Change documentation for collection.build and collection.create [ci-skip]
e67386a
@radanskoric radanskoric Improve Validation Helpers' documentation comments and tests e5a78aa
@rafaelfranca rafaelfranca Merge pull request #20556 from radanskoric/improve-validation-helpers
Improve Validation Helpers' documentation comments and tests
49b63cc
@rafaelfranca rafaelfranca Merge pull request #20712 from nhodges/dev/nh/20345
Remove `config` options from `default_options` in `railties`
329c249
@rohandaxini rohandaxini Maintaining consistency in wordings [ci skip]
"reproduce" word is better suited then "replicate" as its also used at other places in this same document having same context. It will then be consistent across document.
88973f8
@rafaelfranca rafaelfranca Merge pull request #20720 from rohandaxini/patch-2
Maintaining consistency in wording [ci skip]
a821ec1
@kaspth kaspth Merge pull request #20276 from davetron5000/revert-head-on-no-template
Allow default_render to take a block to customize behavior when there's no template
991e98f
@eileencodes eileencodes Improve error messages in cookies_test
Using `assert_predicate` and `assert_match` instead of just `assert` is
preferrable because better error messages are output.

In the case of `assert response.cookies.empty?` the error message was
`Failed assertion, no message given.` but now with `assert_predicate` it
will be `Expected {"user_name"=>"david"} to be empty?.`

For `assert_match(/user_name=david/,
response.headers["Set-Cookie"])` as well, the message returned was
unhelpful - `Failed assertion, no message given.` but now will tell what
was expected and what was returned with `Expected /user_name=david/ to
match "user_name=nope; path=/".`
4d7b507
Commits on Jun 28, 2015
@sgrif sgrif Revert the behavior of association names and `where` to be closer to 4.2
With this change, we will always assume the association name is the same
as the table it's referencing. This is subtly different than treating
the hash key passed to `where` as the table name, as it still allows the
class referenced by the association to provide additional type
information.

After exploring several possible solutions to the ambiguity problem, I
do not think there is a short term answer that will maintain backwards
compatibility.

This change will make it so the following code does not work:

    class User
      has_many :approved_posts, -> { where(approved: true) }, class_name: "Post"
    end

    User.where(approved_posts: { id: 1 })

But prevents potential ambiguity and collision as demonstrated in [this
gist](https://gist.github.com/senny/1ae4d8ea7b0e269ed7a0).

Unfortunately, truely solving this requires significantly
re-architecting this code, so that what is currently represented as an
`Arel::Attribute` is instead another data structure that also references
the association it is representing, so we can identify the proper table
name for aliasing when we construct the final tree.

While I'd still like to accomplish that in the long run, I don't think
I'll be able to get there in time for Rails 5 (since I'm not full time
OSS any more, and this is several weeks worth of work). I'm hoping to
achieve this for Rails 5.1.

Fixes #20308
6a6c4c4
@y-yagi y-yagi fix NoMethodError that occurs when generating scaffold inside full mo…
…de engine
b1738e1
@fxn fxn updates a migration example in the Getting Started guide [ci skip]
Closes #20705.
fd495a8
@yui-knk yui-knk [ci skip] Fix action_controller_overview d9212f6
@claudiob claudiob Merge pull request #20726 from yui-knk/fix/doc_controller
[ci skip] Fix action_controller_overview
aba43b7
@fny fny Improve error message when serializing unsaved records for jobs fd8122a
Commits on Jun 29, 2015
@repinel repinel Fix cache issue when different partials use the same collection
Adds the `virtual_path` option to `cache_fragment_name` so it can
be provided when needed.

That allows `cache_collection_render` to get the appropriate cache
key with the digest generated based on the template and prevent
collision with other templates that cache the same collection.
da16745
@kaspth kaspth Merge pull request #20538 from repinel/fix-render-caching-issue
Fix cache issue when different partials use the same collection
c90c9b2
@akolomiychuk akolomiychuk Add nil check in asset_path 42a1b0c
@senny senny Merge pull request #20669 from akolomiychuk/image-path
Passing nil to image_tag
d4b0e5f
@senny senny Merge pull request #20724 from y-yagi/fix_scaffold_in_full_engine
fix NoMethodError that occurs when generating scaffold inside full mode engine
3cd0530
@senny senny docs, nodoc `NullPreloader` and `AlreadyLoaded`.
These classes are part of Active Record Preloader, which is not part of
the public API.
5aee168
@srikanthps srikanthps To fix #20644
Added a note on development kit for Windows Users.  This is required as Windows users can get frustrated when their first rails project creation would fail as some native gem won't get built.
1b1afc6
@meinac meinac Minor addition to getting started guide for foreign_key description o…
…f references migration [ci skip]
33fac99
@sgrif sgrif Merge pull request #20735 from vngrs/minor_addition_to_getting_started
Minor addition to getting started guide for foreign_key description
9240426
@jordondornbos jordondornbos fix pluralization in doc [ci skip] f5d6aaa
@rafaelfranca rafaelfranca Merge pull request #20739 from jordondornbos/patch-1
fix pluralization in doc [ci skip]
470519d
Commits on Jun 30, 2015
@rafaelfranca rafaelfranca Merge pull request #20734 from srikanthps/master
To fix #20644
1a43302
@radar radar integration_tool defaults to :test_unit
As per railties/lib/rails/test_unit/railtie.rb, where it sets it explicitly.

This can be confirmed by starting a new Rails console session in a new app and running this code:

Rails.application.config.app_generators.rails[:integration_tool]

I also beefed up the documentation slightly to be more explicit about what this configuration setting does.
be0b218
@rafaelfranca rafaelfranca Merge pull request #20741 from radar/integration_tool_doc
Improve integration_tool documentation
6c3fcc5
@senny senny tests, railties tests should use `bin/` executables when possible.
We recommend using the `bin/` executables in our docs and guides.
Let's make sure that our tests execute the same code path.
a8f250a
@senny senny `dump_schema_after_migration` applies migration tasks other than db:m…
…igrate

Closes #20743.

The task `db:_dump` now only dumps the schema if
`ActiveRecord::Base.dump_schema_after_migration` is true. This has
effects:

- `db:migrate:up`
- `db:migrate:down`
- `db:forward`
- `db:rollback`
2183caa
@senny senny follow-up to 2183caa, always reenable the task. #20743 f55c60f
@sgrif sgrif Correct through associations using scopes
The changes introduced to through associations in c80487e were quite
interesting. Changing `relation.merge!(scope)` to `relation =
relation.merge(scope)` should in theory never cause any changes in
behavior. The subtle breakage led to a surprising conclusion.

The old code wasn't doing anything! Since `merge!` calls
`instance_exec` when given a proc, and most scopes will look something
like `has_many :foos, -> { where(foo: :bar) }`, if we're not capturing
the return value, it's a no-op. However, removing the `merge` causes
`unscope` to break.

While we're merging in the rest of the chain elsewhere, we were never
merging in `unscope` values, causing a breakage on associations where a
default scope was being unscoped in an association scope (yuk!). This is
subtly related to #20722, since it appears we were previously relying on
this mutability.

Fixes #20721.
Fixes #20727.
bc6ac86
Commits on Jul 01, 2015
@pwnall pwnall Avoid crashing when minitest-rails is loaded.
The improvments to the test runner's integration with minitest in commit
b6fc8e2 add methods to the Minitest
module that refer to the Rails module. Unfortunately, when the
minitest-rails gem is loaded, the reference is incorrectly resolved to
the Minitest::Rails module.
e334ec4
@kaspth kaspth Merge pull request #20747 from pwnall/fix_minitest_rails
Avoid crashing when minitest-rails is loaded.
1099e54
@robin850 robin850 Separate the constraint and other options [ci skip]
Only one constraint option can be used at a time (except for the minimum
and maximum ones that can eventually be combined). However, other
options can be used with them (e.g. the validation failure message).
So let's make the distinction between these two different options
categories.

[Yves Senn, Matthew Draper & Robin Dupret]
bc71e43
@robin850 robin850 Display a more human readable list of reserved names
Interpolating an array inside a String will call #inspect on it. Let's
call #join to display a more human-readable error message.
42b5906
@repinel repinel [ci skip] Improve the url_for documentation
Clarify the `url_for` usage in mailers.

Re-add the documentation about `url_for` and Route's path parameters,
first introduced by 5c4f185.
This was reported on #15097 and until it is decided to deprecate it
or not, I believe the documentation should exist.
48dc826
@robin850 robin850 Merge pull request #20631 from repinel/improve-url-for-docs
[ci skip] Improve the url_for documentation
776e599
Commits on Jul 02, 2015
@claudiob claudiob [ci skip] Don't use TrueClass, FalseClass in docs
This sort of documentation style comes from 2009, probably due to
the merging of merb (see 38b608e#diff-017d9bc9b1d2bdae199b938d72c15488R120).

Rails follows Ruby's convention to define which values are "truthy" or
"falsey", so there is no need to specify that the returned value must
strictly be a TrueClass or FalseClass. /cc @fxn
352c847
@fxn fxn Merge pull request #20760 from claudiob/remove-true-false-class
[ci skip] Don't use TrueClass, FalseClass in docs
bea7fee
@eileencodes eileencodes Use default model enum in fixtures if not defined
After 908cfef was introduced fixtures that did not set an enum would
return nil instead of the default enum value.

The fixtures should assume the default if a different enum is not
defined.

The change checks first if the enum is defined in the fixture before
setting it based on the fixture.
eff3a31
@eileencodes eileencodes Fix spelling of `Thoughtleadering`
Not much of a thought leader if I can't spell it correctly :wink:
cc7ef0c
@trosborn trosborn changes names in guides to better reflect diversity [ci-skip] b3bfbbf
@y-yagi y-yagi remove unnecessary loading fixtures from `navigation_test.rb`
it has been corrected in 0176aef as for loading of fixtures in `test_helper.rb`,
loading fixtures for each test is unnecessary.
4e4ad5f
Commits on Jul 03, 2015
@rafaelfranca rafaelfranca Merge pull request #20766 from trosborn/diversity
changes names in guides to better reflect diversity
626b10e
@jonatack jonatack [skip ci] #distinct instead of #uniq
as #uniq will be removed from Rails 5.0 as per the Active Support
exception raised:

ActiveSupport::DeprecationException: DEPRECATION WARNING: uniq is
deprecated and will be removed from Rails 5.0 (use distinct instead).
6440161
@maurogeorge maurogeorge Create Adding images in Action Mailer Views on guides
[ci skip]
9cc438f
@kaspth kaspth Merge pull request #20773 from jonatack/distinct-instead-of-deprecate…
…d-uniq

[skip ci] #distinct instead of #uniq
6cd768f
Commits on Jul 04, 2015
@vijaydev vijaydev Merge pull request #20764 from maurogeorge/mailer_image
Create Adding images in Action Mailer Views on guides
f09678b
Commits on Jul 05, 2015
@y-yagi y-yagi remove reference to `country_options_for_select` and `country_select`…
… from guide [ci skip]

these methods were removed in 2d27b82
bba409e
@robin850 robin850 Merge pull request #20780 from y-yagi/action_view_overview_guide
remove reference to `country_options_for_select` and `country_select` from guide [ci skip]
798ad25
@kaspth kaspth Fix the random caching test failure. 90ebba6
@kaspth kaspth Merge pull request #19877 from fny/job-global-id-error-improvement
Improve error message when serializing unsaved records for jobs, Fixes #19861
ba400c7
@kaspth kaspth Add gemfile entry for GlobalID until a new release is cut. 5294bf1
@eileencodes eileencodes Refactor cookie_jar to decouple it from request object
This change decouples `cookie_jar` allocation from the request object.
We need this for moving controller tests to integration tests so we can
access the `cookie_jar` object separately.
a05e245
@eileencodes eileencodes Merge pull request #20748 from robin850/reserved-names
Display a more human readable list of reserved names
4d737a4
@xijo xijo ActionMailer::MessageDelivery respects current I18n.locale
When #deliver_now is called all translations within the
generated email will be looked up for the current I18n
locale.

    I18n.locale = ‘de’
    mail.deliver_now # Generates german email, correct

In #enqueue_delivery the locale was not considered and
the resulting job uses the default locale.

    I18n.locale = ‘de’
    mail.deliver_later # Generate english email, incorrect

In order to achieve a consistent behaviour the current locale
is now always passed to `ActionMailer::DeliveryJob`.
ca2387e
@matthewd matthewd Merge pull request #20782 from kaspth/fix-controller-caching-test
Fix the random caching test failure. (Take two)
3046c9b
@kaspth kaspth Merge pull request #20758 from xijo/action_mailer_message_delivery_re…
…spects_i18n_locale

ActionMailer::MessageDelivery respects current I18n.locale
f2a8c23
Commits on Jul 06, 2015
@senny senny Merge pull request #20767 from y-yagi/remove_unnecessary_fixture_method
remove unnecessary loading fixtures from `navigation_test.rb`
74c7246
@maurogeorge maurogeorge Add to RDoc of OrderedOptions the bang info
[ci skip]
912418f
@maurogeorge maurogeorge Add to Security guides the secrets.yml
[ci skip]
35373fd
@robin850 robin850 Merge pull request #20778 from maurogeorge/ordered_options_bang_doc
Add to RDoc of OrderedOptions the bang info [ci skip]
c9ca063
@robin850 robin850 Merge pull request #20779 from maurogeorge/secrets-guides
Add to Security guides the secrets.yml [ci skip]
472984b
@arthurnn arthurnn Merge pull request #13897 from gmalette/nested-parameter-filtering-2
Allow filtering params based on parent keys
e598967
Commits on Jul 07, 2015
@pwnall pwnall Add test proving that accepts_nested_attributes_for is secure against…
… ID tampering attacks.
fccb076
@senny senny Merge pull request #20793 from pwnall/nested_test
Test proving that accepts_nested_attributes_for is secure against ID tampering attacks
c66335d
@vredniy vredniy Update CHANGELOG.md
3d5580f
@robin850 robin850 Merge pull request #20794 from vredniy/patch-1
Update CHANGELOG.md [ci skip]
cf579b4
@senny senny docs, remove accidental :nodoc: of ActiveModel::Validations::ClassMet…
…hods methods.

[ci skip]

While this :nodoc: did hide the constant it also removed the following
methods from the API docs:

- #attribute_method?
- #clear_validators!
- #validate
- #validators
- #validators_on

Those are public API and should be visible.

Issue was caused by dee4fbc

/cc @zzak
b896266
@senny senny docs, clarify the meanaing of return values from validation methods.
[ci skip]

Closes #20792.

Custom validation methods are implemented in terms of
callbacks. The `validate` callback chain can't be halted using return
values of individual callbacks.
4cc5917
@rafaelfranca rafaelfranca Fix regression caused by a01d164
When preload is used in a default scope the preload_values were
returning nested arrays and causing the preloader to fail because it
doesn't know how to deal with nested arrays. So before calling preload!
we need to splat the arguments.

This is not needed to includes because it flatten its arguments.
1b4399d
@kaspth kaspth Revert "Merge pull request #20758 from xijo/action_mailer_message_del…
…ivery_respects_i18n_locale"

This reverts commit f2a8c23, reversing
changes made to 3046c9b.
062cbd1