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
Commits on Mar 10, 2014
@rafaelfranca rafaelfranca Merge pull request #8313 from alan/only_save_changed_has_one_objects
Save has_one associations only if record has changes

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
3fa487d
Commits on Mar 11, 2014
@arthurnn arthurnn Fixes STI when 2+ levels deep.
PR #14052 Added a regression where it was only looking for methods in one
level up, So when the method was defined in a 2+ levels up the
inheritance chain, the method was not found as defined.
ed7bffc
Commits on Mar 12, 2014
@tenderlove tenderlove only write the jar if the response isn't committed
when streaming responses, we need to make sure the cookie jar is written
to the headers before returning up the stack. This commit introduces a
new method on the response object that writes the cookie jar to the
headers as the response is committed.  The middleware and test framework
will not write the cookie headers if the response has already been
committed.

fixes #14352
890aa15
Commits on Mar 13, 2014
@tenderlove tenderlove use the body proxy to freeze headers
avoid freezing the headers until the web server has actually read data
from the body proxy.  Once the webserver has read data, then we should
throw an error if someone tries to set a header

Conflicts:
	actionpack/lib/action_controller/metal/live.rb
3022c15
@orangejulius orangejulius Use Sqlite3 adapter in examples
Two bits of example code use sqlite as an adapter, which doesn't exist.
Using the code verbatim will raise a LoadError exception:

    ActiveRecord::Base.establish_connection(
      "adapter"  => "sqlite",
      "database" => "db.sqlite"
    )
    # => LoadError: Could not load 'active_record/connection_adapters/sqlite_adapter'...

Considering this is code a lot of people new to Rails might be running,
it's especially confusing.

Closes #14367 [ci skip]
daf7e25
@tenderlove tenderlove make tests pass on Ruby 2.2
Apparently we've been using a buggy feature for the past 6 years:

  https://bugs.ruby-lang.org/issues/9593
901a0cf
@tenderlove tenderlove require actions rather than create_file
thor's create_file seems to have a circular dependency on itself when
used with our constant loading stuff.

fixes #14319
d30a377
@rafaelfranca rafaelfranca Merge pull request #14372 from arthurnn/fix_query_cache_binds
Make select_all on query cache accept a Relation without binds.
Conflicts:
	activerecord/CHANGELOG.md
b0a9853
@rafaelfranca rafaelfranca No need to binds be optional cc987c9
@afshinator afshinator Fix probs in sections 5.6 and 5.9; [ci skip] 97e0d6b
Commits on Mar 14, 2014
@rafaelfranca rafaelfranca Force sass-rails ~> 4.0.2 to avoid sprockets compatibility error
See rails/sass-rails#191 for more information
4fd3c47
@rafaelfranca rafaelfranca Match the whole string c32365d
@rafaelfranca rafaelfranca Take in consideration guides CHANGELOG 4dd5fe6
@rafaelfranca rafaelfranca Merge pull request #14329 from pch/digestor-lookup-fix
Ensure LookupContext in Digestor selects correct variant
5f9f2cd
@rafaelfranca rafaelfranca Fix the resolver cache and stop mutating the lookup_context
Before we had a bug in the resolver cache so the disable_cache were not
working when passing options to find
fe5f2b4
@rafaelfranca rafaelfranca Merge pull request #14373 from schneems/schneems/jdbc-ar-2
Allow custom JDBC urls
6907235
@carlosantoniodasilva carlosantoniodasilva Obey `validate: false` option for habtm
Fixes #14383.
b46e75b
Commits on Mar 15, 2014
@jeremy jeremy Remove deprecation on active_support/core_ext/class/attribute_accesso…
…rs requires. Appropriate to keep this, users don't care that the implementation got unified.
178e261
@jeremy jeremy Clarify AV::Digestor.digest method signature docs and deprecation war…
…ning
10ab2b0
Commits on Mar 16, 2014
@arthurnn arthurnn Fix MailerPreview broken tests
`BaseMailerPreview.welcome` is an instance method, so we need to stub the
method on a instance level and not on Class. The stub is important to make
sure the Message object is the same in the other expectations.
This was working randomly because Mocha uses == to compare two objects
on the `with()` expectation and even if the Mail::Message objects were
not the same object they are equal, but thats not the case in 100% of
the runs. So we need to make sure we use `.any_instance` method and have
the right message object.
19ebb28
@rafaelfranca rafaelfranca Merge pull request #14397 from arthurnn/fix_mailer_preview_test_41
Fix MailerPreview broken tests
d1cfcb5
@pixeltrix pixeltrix Use nested_scope? not shallow? to determine whether to copy options
The method `shallow?` returns false if the parent resource is a singleton so
we need to check if we're not inside a nested scope before copying the :path
and :as options to their shallow equivalents.

Fixes #14388.

(cherry picked from commit 924345abcff0101e3221f87d1d56d3d6517a79a4)

Conflicts:
	actionpack/CHANGELOG.md
236bc35
@amatsuda amatsuda Let COMMAND_WHITELIST be an Array, not a String fc70235
@jeremy jeremy Remove changelog for 7dfbd91 since the refactoring no longer affects …
…users after 7a5601c
cdf4293
Commits on Mar 17, 2014
@senny senny fix `number_to_percentage` with `Float::NAN`, `Float::INFINITY`.
Closes #14405.

This is a follow-up to 9e997e9 to restore
the documented behavior.

Conflicts:
	actionview/CHANGELOG.md
3711112
@senny senny `where.not` adds `references` for `includes`.
Closes #14406.

Conflicts:
	activerecord/CHANGELOG.md
b5abb4b
Commits on Mar 18, 2014
@tenderlove tenderlove Merge pull request #14090 from Fortisque/kevin/stream_error_in_main_t…
…hread_if_not_committed

re-raise error if error occurs before committing in streaming
65533c3
@arthurnn arthurnn Add counter cache test for class_name
Backport test from #14410
4fc1ca3
@chancancode chancancode Merge pull request #14414 from arthurnn/port_test_cc_41
Add counter cache test for class_name
47c3e06
Commits on Mar 19, 2014
@dhh dhh Fix for digestor to consider variants for partials -- this still need…
…s more testing!!
20845f6
@dhh dhh Log the full path, including variant, that the digestor is trying to …
…find
df0bb78
@chancancode chancancode Added a warning about serializing data with JSON cookie jars [skip ci]
Closes #14409
6cef846
Commits on Mar 20, 2014
@senny senny only dump schema information if migration table exists. Closes #14217
Conflicts:

	activerecord/CHANGELOG.md
4c99710
@chancancode chancancode The digest option is no longer honoured since Rails 3.0 [ci skip]
Closes #8513
482fa29
@senny senny test for structure:dump without schema information table. refs eafec46
This is a test case for the fix provided in eafec46
dbd84b4
Commits on Mar 21, 2014
@dhh dhh Digestor should just rely on the finder to know about the format and …
…the variant -- trying to pass it back in makes a mess of things (oh, and doesnt work)
958199a
@dhh dhh Update test helper to use latest Digestor API 239c1b3
Commits on Mar 23, 2014
@vlal vlal Swapped parameters of assert_equal in assert_select b423eba
Commits on Mar 25, 2014
@rafaelfranca rafaelfranca Merge pull request #14468 from izoomi/date_select_helper
Fix date_select with_css_classes: true option overwriting other html classes
193062e
@senny senny synchronize changelogs and 4.1 release notes. [ci skip] a5bff17
@dhh dhh Add warning about changed Digestor cache_key c325b64
@rafaelfranca rafaelfranca Merge pull request #14390 from huoxito/true-touch
Still touch associations when theres no timestamp
97b40f6
@rafaelfranca rafaelfranca Use rails convetions 15e83ed
@rafaelfranca rafaelfranca Fix the update_versions release task e0c93e8
@rafaelfranca rafaelfranca Fix task comment to match which file should be changed
[ci skip]
d4d0307
Commits on Mar 26, 2014
@rafaelfranca rafaelfranca Merge pull request #14487 from JuanitoFatas/patch/fix-release-note-url
[ci skip] Fix Pull Request URL in 4.1 release note.
5ac4d6e
Commits on Mar 27, 2014
@rafaelfranca rafaelfranca Edge Rails applications doesn't need to use arel master
Conflicts:
	railties/lib/rails/generators/app_base.rb
a6a8f9a
@rafaelfranca rafaelfranca Fix build with bundler 1.6 8fa883f
@rafaelfranca rafaelfranca Fix test case 9ec117d
@rafaelfranca rafaelfranca Merge pull request #14393 from chrisfinne/persisted_exception
AR .persisted? throws SystemStackError for an unsaved model with a
custom primary_key that didn't save due to validation error

Conflicts:
	activerecord/CHANGELOG.md
d6c704f
@rafaelfranca rafaelfranca Merge pull request #14469 from tiegz/timestamp_inheritance_fix
Swap Timestamp/Callbacks order in ActiveRecord::Base
799a7bc
Commits on Mar 28, 2014
@al2o3cr al2o3cr Pass a base relation to build_default_scope when joining
This allows the default scope to be built using the current table alias.
Resolves #12770
0f73bc9
@tenderlove tenderlove Merge pull request #14508 from al2o3cr/pull14154-4-1-stable
Backport #14154 to 4-1-stable
bbb4566
@rafaelfranca rafaelfranca Merge pull request #12778 from etehtsea/rake-default-fix
Don't load test env by default.

Closes #13241
38cf00e
@Peeja Peeja HashWithIndifferentAccess better respects #to_hash
In particular, `#update`, `#merge`, `#replace` all accept objects which
respond to `#to_hash`, even if those objects are not Hashes directly.
939f4ea
@kreynolds kreynolds Replace trivial regexp with string or include, twice as fast 89a7187
@fxn fxn Merge pull request #14522 from kreynolds/replace-regexp-with-include-…
…or-string-4-1

Replace trivial regexp with string or include, twice as fast
c41167b
Commits on Mar 29, 2014
@chancancode chancancode Ensure we are returning either `true` or `false` for `#==`
460eb83 cused `ActiveRecord::Base#==` to sometimes return `nil` in some cases,
this ensures we always return a boolean value. Also fixed a similar problem in
AR reflections.
d5c9fc5
Commits on Mar 30, 2014
@rafaelfranca rafaelfranca Merge pull request #14518 from Peeja/hash-wia-update-respects-to-hash…
…-4-1-stable

HashWithIndifferentAccess better respects #to_hash (4-1-stable backport)
6e257b0
@rafaelfranca rafaelfranca Merge pull request #14528 from planas/patch-1
Require yaml explicitly on #database_configuration
c40bfc6
@rafaelfranca rafaelfranca Merge pull request #14509 from lukesteensen/pg-array-defaults
remove calls to sql_type on pg columns
Conflicts:
	activerecord/test/cases/adapters/postgresql/array_test.rb
2340c74
Commits on Mar 31, 2014
@iancanderson iancanderson Tiny doc fix for Strong Parameters
- accepts_nested_attribute_for -> accepts_nested_attributes_for
440c191
@guilleiguaran guilleiguaran Merge pull request #14539 from lparedes/master
Do not overwrite selected and disabled attributes
443d3f3
Commits on Apr 02, 2014
@carlosantoniodasilva carlosantoniodasilva Fix cookie serializer docs
The option actually needs to be set on action_dispatch. [ci skip]

Conflicts:
	guides/source/upgrading_ruby_on_rails.md
c13169d
Commits on Apr 03, 2014
@rafaelfranca rafaelfranca Merge pull request #14570 from matthewd/uri_deprecation_warning
Avoid a spurious deprecation warning for database URLs
d1a94dc
@matthewd matthewd Revise 'sqlite3:' URL handling for smoother upgrades
Restore the 4.0 behaviour for 'sqlite3:///', but deprecate it. We'll
change to the absolute-path interpretation in 4.2.

The current "correct" spellings for in-memory, relative, and absolute
URLs, respectively, are:

    sqlite3::memory:
    sqlite3:relative/path
    sqlite3:/full/path

Substantially reverses/defers fbb79b5.
Uncovered by @guilleiguaran while investigating #14495, though that
sounds like a different issue.

Conflicts:
	activerecord/CHANGELOG.md
1118724
@tenderlove tenderlove Merge pull request #14532 from thedarkone/polymorphic-preload-fix
Fix polymorphic preloads on NOT NULL _type columns
33c1dbd
@rafaelfranca rafaelfranca Merge pull request #14588 from matthewd/kernel_y_with_spring
Explicitly load Kernel#y when starting a console
1b2ea12
@rafaelfranca rafaelfranca Merge pull request #14572 from laurocaetano/with_options_and_scope
Fix error when using `with_options` with lambda.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/has_many_associations_test.rb
8b48b21
@rafaelfranca rafaelfranca Merge pull request #14582 from arthurnn/blacklist_ruby_methods
Blacklist ruby keywords for scopes
0f05fbf
Commits on Apr 04, 2014
@rafaelfranca rafaelfranca Merge pull request #14597 from matthewd/kernel_y_for_1_9_option_1
Ensure we supply Kernel#y for 1.9 too
2386d15
@rafaelfranca rafaelfranca Merge pull request #14562 from jefflai2/collection_proxy
CollectionProxy uses the arel of its association's scope.

Conflicts:
	activerecord/CHANGELOG.md
b097ebe
@rafaelfranca rafaelfranca Make possible to use sprockets 2.1 cdd6018
@rafaelfranca rafaelfranca Use sass-rails 4.0.3 322d5a3
@rafaelfranca rafaelfranca Declare the assets dependency dffb9c5
@rafaelfranca rafaelfranca Merge pull request #11650 from prathamesh-sonpatki/rename
Renamed private methods _create_record and _update_record
df1df87
@rafaelfranca rafaelfranca Fix the test defining the models in the right place 7a2eb62
Commits on Apr 07, 2014
@spastorino spastorino Merge pull request #14631 from laurocaetano/fix_count_with_order
Ignore order when doing count.
ff69589
@rafaelfranca rafaelfranca Merge pull request #14609 from evanwhalen/enums_inheritance
Make enums distinct per class
Conflicts:
	activerecord/CHANGELOG.md
222d207
@rafaelfranca rafaelfranca Rails.application should be set inside before_configuration hook
Fixes #14620
4d56b87
Commits on Apr 08, 2014
@chancancode chancancode Follow up to bbe7fe4 to fix enum leakage across classes.
The original attempt didn't really fix the problem and wasn't testing the
problematic area. This commit corrected those issues in the original commit.

Also removed the private `enum_mapping_for` method. As `defined_enums` is now a
method, this method doesn't provide much value anymore.

Conflicts:
	activerecord/lib/active_record/validations/uniqueness.rb
30cdb28
@chancancode chancancode Ensure we are looking with string keys 98ebec1
@rafaelfranca rafaelfranca Merge pull request #14633 from matthewd/narrow_database_url
Only apply DATABASE_URL for Rails.env
ce7e3d5
@dhh dhh Use short-form for the scaffold render calls and drop the needless test 1fba21a
@dhh dhh Dont encourage aliases now that we have variants 094b961
@dhh dhh Dont abbreviate that which needs no abbreviation f08665e
@rafaelfranca rafaelfranca Merge branch '4-1-0' into 4-1-stable
Conflicts:
	actionpack/CHANGELOG.md
	actionview/CHANGELOG.md
	activerecord/CHANGELOG.md
cf70674
@rafaelfranca rafaelfranca Merge pull request #14647 from matiaskorhonen/updates-maintenance-policy
Updates the maintenance policy with new Rails versions
Conflicts:
	guides/CHANGELOG.md
ae9fef3
Commits on Apr 09, 2014
@vdmgolub vdmgolub Guides: minor typo fixed [ci skip] fe79ddb
@senny senny upgrading section for 4.1 is no longer WIP. [ci skip] 00a3dd1
@rafaelfranca rafaelfranca Merge pull request #14654 from Alamoz/secret_key
Expand explanation of how to set secrets.yml.
e3eab91
@rafaelfranca rafaelfranca Merge pull request #14667 from lucasmazza/require-per-thread-registry
Add missing require so requiring `active_support/cache` works again.
40fec3d
@rafaelfranca rafaelfranca Merge pull request #14665 from andrielfn/avoid-uri-parsing
Avoid URI parsing
58e53c2
@tenderlove tenderlove Merge pull request #14668 from laurocaetano/source_option_with_string…
…_value

The :source option for has_many => through should accept String values.
e46ff16
Commits on Apr 10, 2014
@senny senny Merge pull request #14679 from pbharadiya/master
Correct factual error for page not found [ci skip]
b09eac1
@rafaelfranca rafaelfranca Require action_controller before any other action_controller file
This will load properly the loading hooks.

Closes rails/sass-rails#205
c077cbe
@rafaelfranca rafaelfranca Merge pull request #12829 from iantropov/issue_insert_via_hmt_scope_3548
Fix insertion of records for hmt association with scope

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
74d920d
Commits on Apr 11, 2014
@senny senny docs, make association `autosave: true` examples runnable. Closes #14700


[ci skip]

The examples are written in a way you expect them to be executable.
However one snippet assumed there to be two comments when only one
was created above.

The defined models did not extend `ActiveRecord::Base`

The example used `comments.last.mark_for_destruction`. This does no
longer load the whole collection but just the last record. It is
then refetcht on subsequent calls to `last`. This breaks the example.
daea4cf
@pixeltrix pixeltrix Merge pull request #14684 from Futurelearn/jc-deep-nested-shallow-url…
…-helper-bug

Add a failing test for a URL helper that was broken by a6b9ea2.

(cherry picked from commit 1424482)

Conflicts:
	actionpack/CHANGELOG.md
176ce1d
@rafaelfranca rafaelfranca Merge pull request #14689 from matthewd/asset_initializer
Move assets precompile (and version) to an initializer
Conflicts:
	railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt
48e7203
@rafaelfranca rafaelfranca Fix version indicator on guides and link to Rails 4.0 [ci skip] 7f6bd0a
@rafaelfranca rafaelfranca Merge branch 'rm-fix-13648'
Includes #14711 and some cleanup
commits.

Fixes #13648

Conflicts:
	activerecord/CHANGELOG.md
968c581
Commits on Apr 12, 2014
@joankaradimov joankaradimov Check if the `request` variable isn't nil when calling render_to_string
closes #14125
b9f6d14
Commits on Apr 13, 2014
@senny senny PostgreSQL, warn once per connection per missing OID. Closes #14275.
[Yves Senn & Matthew Draper]

(cherry picked from commit 9f62344)

This is a partial backport of #14692.

Conflicts:
    activerecord/CHANGELOG.md
    activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
    activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
461171b
@rafaelfranca rafaelfranca Merge pull request #14592 from laurocaetano/equality_between_relation…
…_and_collection_proxy

The comparison between `Relation` and `CollectionProxy` should be consistent.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
6c61893
Commits on Apr 14, 2014
@senny senny Merge pull request #14739 from oysta/guide-fixes
Fix some inconsistent references between text and example code in getting started guide [ci skip]
2f8cb89
@senny senny docs, double meaning of `serialize` argument. Closes #14284.
The second argument to serialize has double meaning:
  * `class_name` of the Type to serialize
  * `coder` to use then serializing.

The new variable name and the docs better describe that behavior.
aaeff0e
@rafaelfranca rafaelfranca Merge pull request #14736 from nashby/hidden-index
`collection_check_boxes` respects `:index` option for the hidden filed name
Conflicts:
	actionview/lib/action_view/helpers/tags/collection_check_boxes.rb
	actionview/test/template/form_collections_helper_test.rb
c07bfd3
@rafaelfranca rafaelfranca Use the index on hidden field 5f768ea
@rafaelfranca rafaelfranca Return null type format when format is not know
When requesting a controller with the following code with a unknown format:

    def my_action
      respond_to do |format|
        format.json { head :ok }
        format.any { render text: 'Default response' }
      end
    end

we should render the default response instead of raising ActionController::UnknownFormat

Fixes #14462

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/test/controller/mime/respond_with_test.rb
320124f
@rafaelfranca rafaelfranca Make console and generators blocks works at Application instance level
Like rake tasks and runner blocks these blocks should also being shared
between applications since they are stored at the classes.

Fixes #14748

Conflicts:
	railties/test/application/configuration_test.rb
69da9a8
Commits on Apr 15, 2014
@senny senny Merge pull request #14728 from stomar/assertion-msg
Remove surplus period from assertion messages
ba71deb
@senny senny Merge pull request #14758 from JuanitoFatas/migrations-md
[ci skip] Add missing end in one of the examples in Migrations.md.
39a607f
@rafaelfranca rafaelfranca Merge pull request #14756 from laurocaetano/fix-count-on-association-…
…relation

Fix count on association relation (calls to empty and size).
6047c6b
@rafaelfranca rafaelfranca Merge pull request #14766 from eric-chahin/migration_bug
Changed change_column in PG schema_statements.rb to make sure that the u...
Conflicts:
	activerecord/test/cases/adapters/postgresql/uuid_test.rb
00fd52b
@rafaelfranca rafaelfranca Merge pull request #14768 from spectator/ac_metal_docfix
Update AC::Metal documentation example

[ci skip]
945c44c
@rafaelfranca rafaelfranca Fix merge conflict 5f8b8c3
Commits on Apr 16, 2014
@rafaelfranca rafaelfranca Merge pull request #14770 from crazymykl/avoid_dos_vuln_in_i18n_guide
Avoid suggesting dangerous code in i18n guide
a1439bb
@Emily Emily Fixed problem where `1.day.eql?(1.day)` is false
This fixes:
    1.second.eql?(1.second) #=> false

The new `eql?` requires that `other` is an `ActiveSupport::Duration`.
This requirement makes `ActiveSupport::Duration`'s behavior consistent
with other numeric types in Ruby.

    1.eql?(1.0) #=> false
    1.0.eql?(1) #=> false

    1.second.eql?(1) #=> false (was true)
    1.eql?(1.second) #=> false

    { 1 => "foo", 1.0 => "bar" }
    #=> { 1 => "foo", 1.0 => "bar" }

    { 1 => "foo", 1.second => "bar" }
    # now => { 1 => "foo", 1.second => "bar" }
    # was => { 1 => "bar" }

And though the behavior here hasn't changed, for reference:

    1 == 1.0 #=> true
    1.0 == 1 #=> true

    1 == 1.second #=> true
    1.second == 1 #=> true

Conflicts:
	activesupport/CHANGELOG.md
4988d34
@senny senny Merge pull request #14773 from eric-chahin/null_relation_fix
Changed the NullRelation so that when count is called with #group it wil...
Conflicts:
	activerecord/CHANGELOG.md
b31b2fe
@tenderlove tenderlove Merge pull request #14546 from eileencodes/fix_delete_all_to_not_use_…
…IN_statement

Fix delete all to not produce sql in statement
Conflicts:
	activerecord/test/cases/associations/has_many_associations_test.rb

Merge pull request #14727 from robin850/patch-17

Add a changelog entry for #14546 [ci skip]
Conflicts:
	activerecord/CHANGELOG.md
4bdff5b
Commits on Apr 17, 2014
@rafaelfranca rafaelfranca Merge pull request #14783 from hakanensari/autoload-strict-validation…
…-failed

Autoload ActiveModel::StrictValidationFailed
2a72514
Commits on Apr 18, 2014
@rafaelfranca rafaelfranca Merge pull request #14793 from arthurnn/fixes_8928
Fixed has_many association to make it support irregular inflections.
Conflicts:
	activerecord/CHANGELOG.md
87a2f02
@senny senny Merge pull request #14796 from kuldeepaggarwal/fix-save-issue
when a destroyed record is duped, it is no longer ´destroyed?`.
c1d9c11
Commits on Apr 20, 2014
@nanaya nanaya Make URL escaping more consistent
1. Escape '%' characters in URLs - only unescaped data
   should be passed to URL helpers

2. Add an `escape_segment` helper to `Router::Utils`
   that escapes '/' characters

3. Use `escape_segment` rather than `escape_fragment`
   in optimized URL generation

4. Use `escape_segment` rather than `escape_path`
   in URL generation

For point 4 there are two exceptions. Firstly, when a route uses wildcard
segments (e.g. *foo) then we use `escape_path` as the value may contain '/'
characters. This means that wildcard routes can't be optimized. Secondly,
if a `:controller` segment is used in the path then this uses `escape_path`
as the controller may be namespaced.

Fixes #14629, #14636 and #14070.

Cherry picked from:
  e2ef83f
  a617925
  5460591

Conflicts:
	actionpack/CHANGELOG.md
8a06764
Commits on Apr 22, 2014
@arunagw arunagw Changed miss-leading comment [ci skip]
After this 21dbe6f

2.1.1 :001 > 'business'.classify
 => "Business"

2.1.1 :004 > 'calculus'.classify
 => "Calculu"
2.1.1 :005 >

Conflicts:
	activesupport/lib/active_support/inflector/methods.rb
3601932
@rafaelfranca rafaelfranca Merge pull request #14573 from habermann24/has_many_through_fix
Properly handle scoping with has_many :through. Fixes #14537.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/has_many_through_associations_test.rb

Conflicts:
	activerecord/CHANGELOG.md
c35e438
@rafaelfranca rafaelfranca Merge pull request #14757 from estsauver/14752
Fix behavior of select! to be consistent with select #14752
cfa53cc
@rafaelfranca rafaelfranca Fix syntax error ab4f8ec
@rafaelfranca rafaelfranca Perfer to define methods instead of calling test
This file is using this pattern already
fda3653
Commits on Apr 23, 2014
@senny senny Merge pull request #14842 from lucasmazza/lm-no-touching-callbacks
Move `NoTouching` down the inheritance chain on AR::Base
Conflicts:
	activerecord/test/cases/timestamp_test.rb
c20fe80
@rafaelfranca rafaelfranca Merge pull request #14852 from matthewd/fix_build_for_assets
Fix railties asset tests: precompile the image we're referencing
Conflicts:
	railties/test/application/assets_test.rb
1c7eec1
Commits on Apr 24, 2014
@ebouchut ebouchut Fix a typo in the doc of forty_two AR FinderMethod [ci skip] 24d8206
@senny senny Merge pull request #13890 from achempion/syntax-error-backtrace
append link to bad code when error type is SyntaxError
Conflicts:
	actionpack/CHANGELOG.md
906f339
Commits on Apr 25, 2014
@senny senny Merge pull request #14853 from kassio/kb-fix-custom-join-table-habtm
Fix to use custom join table in habtm
Conflicts:
	activerecord/CHANGELOG.md
98b56ed
Commits on Apr 27, 2014
@anm anm PostgreSQL, Fix handling of exclusive lower bound for int/date ranges.
[River MacLeod & Yves Senn]

Closes #14797.

This behavior is fixed on `master` by using `from.succ`. However, the
lower bownds exclusion is flawed and was deprecated. This fix is to make
it behave consistently until it's removed.
099efc0
Commits on Apr 29, 2014
@senny senny Merge pull request #14139 from anilmaurya/master
[ci skip] updating active_record/associations to demonstrate where conflict with eager loading.
4841ad3
Commits on May 01, 2014
@rafaelfranca rafaelfranca Merge pull request #13640 from maginatics/fix_sqlite3_ensure_master
SQLite3: Always close statements.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
ea8603f
@rafaelfranca rafaelfranca Merge pull request #14915 from juanpastas/patch-1
Update mapper.rb

[ci skip]
d78368e
@rafaelfranca rafaelfranca Merge pull request #14932 from phoet/use_file_join
always use File.join in asset_path
Conflicts:
	actionview/CHANGELOG.md
88ee47d
@rafaelfranca rafaelfranca Merge pull request #14896 from jetthoughts/14895_overide_strict_by_sq…
…l_mode

Symbolize variables of mysql/mysql2 connection configuration

Conflicts:
	activerecord/CHANGELOG.md
970ca2c
Commits on May 04, 2014
@robin850 robin850 Rails One Click is not maintained anymore [ci skip]
Let's tell people that they should rely on Tokaido instead of Rails One
Click.

Fixes #14960.
9c05300
@rafaelfranca rafaelfranca Merge pull request #14946 from jcoleman/fix-null-binary-column-loggin…
…g-exception

Fix exception when logging SQL w/ nil binary value.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
affa34b
@rafaelfranca rafaelfranca Merge pull request #14949 from bogdan/empty-hash-array-parameterization
[Fixes #14948] Hash#to_query: right serialization for  empty hash and array
Conflicts:
	activesupport/CHANGELOG.md
3b1ade1
Commits on May 05, 2014
@rafaelfranca rafaelfranca Merge pull request #14978 from bogdan/relation-join
[Regression 4.0 -> 4.1] Put back Relation#join method as a delegate to Array
e8a2db2
Commits on May 06, 2014
@rafaelfranca rafaelfranca Merge branch '4-1-sec' into 4-1-stable
Conflicts:
	actionmailer/CHANGELOG.md
	actionpack/CHANGELOG.md
	actionview/CHANGELOG.md
	activemodel/CHANGELOG.md
	activerecord/CHANGELOG.md
	activesupport/CHANGELOG.md
	guides/CHANGELOG.md
	railties/CHANGELOG.md
561811f
Commits on May 07, 2014
@arunagw arunagw Update links to new rails version in guides [ci skip] cd9222a
@senny senny Merge pull request #15012 from schneems/schneems/headers-key
HTTP::Headers#key? correctly converts
4214063
@rafaelfranca rafaelfranca Merge branch 'rm-trasaction-fix-13166'
Conflicts:
	activerecord/CHANGELOG.md

Backport of #13166
e8f5a34
@rafaelfranca rafaelfranca Merge pull request #12746 from coreyward/master
Fix Hash#deep_merge bug and improve documentation — resolves #12738
f100f29
@rafaelfranca rafaelfranca Merge pull request #15015 from pothibo/database-configuration
Use Rails::Paths::Path#existent in database_configuration
Conflicts:
	railties/CHANGELOG.md
19c2f39
Commits on May 08, 2014
@arthurnn arthurnn Dup the changed_attributes otherwise we could lose them 007b1e6
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14992 from fredwu/habtm_relation_size_calculation…
…_fix

Habtm relation size calculation fix. Fixes #14913, Fixes #14914.

Conflicts:
	activerecord/CHANGELOG.md
afb44f4
@tenderlove tenderlove set a constant for the "anonymous" habtm model fixes #15022
I wanted the middle model to be anonymous, but we have to give it a name
for marshal support. :'(
7a599b5
Commits on May 09, 2014
@rafaelfranca rafaelfranca Merge pull request #15042 from arthurnn/revert_dirty_transactions
Reverts dirty track restore on transactions rollback
Conflicts:
	activerecord/CHANGELOG.md
d228286
@rafaelfranca rafaelfranca Merge pull request #15044 from zzak/travis_ruby_too_won
Only need MINOR version level to test Ruby 2.1.x on Travis
Conflicts:
	.travis.yml
7ab8faf
@tenderlove tenderlove use fnmatch to test for case insensitive file systems d49f2b7
Commits on May 10, 2014
@tenderlove tenderlove feature detect for FNM_EXTGLOB for older Ruby. Fixes #15053 16ce285
Commits on May 11, 2014
@guiocavalcanti guiocavalcanti ActionDispatch::Http::URL.normalize_port should not strip port for pr…
…otocol relative URL.

(cherry picked from commit be93d94)
fb20253
@pixeltrix pixeltrix Always use the provided port for protocol relative urls
There may be situations where you need to tunnel SSL connections over
port 80 so we shouldn't remove it if it has been explicitly provided.

(cherry picked from commit 2378f69)

Conflicts:
	actionpack/CHANGELOG.md
12bbc5b
Commits on May 12, 2014
@senny senny Merge pull request #10505 from patricksrobertson/bigserial_id_not_ide…
…ntifying_pk

Handle other pk types in PostgreSQL gracefully.

Closes #10505.

- rebased
- test slightly modified

Conflicts:
	activerecord/CHANGELOG.md
dc7f47d
@senny senny Merge pull request #13334 from gregolsen/postgresql_infinity
pg, fix Infinity and NaN values conversion.

Closes #13334.

* rebased
* removed guard
* inlined guard into case statement
23fb530
@senny senny pg, `change_column_default` accepts `[]`. Closes #11586.
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
b489dbf
Commits on May 13, 2014
@senny senny Merge pull request #14999 from yahonda/modify_bind_variable_name
Modify assert conditions not to be affected
by each database bind variable naming conventions

Closes #14999.

Conflicts:
	activerecord/test/cases/relation/merging_test.rb
741abc9
@senny senny docs, explain usage of `count` + `select`. Closes #15065. [ci skip] 3023363
@arthurnn arthurnn Fix regression on `assert_redirected_to`.
`assert_redirected_to` would fail if there is no controller set on
a `ActionDispatch::IntegrationTest`, as _compute_redirect_to_location
would be called on the controller to build the url.

This regression was introduced after 1dacfba.

[fixes #14691]
b199a00
@rafaelfranca rafaelfranca Merge pull request #15090 from arthurnn/fix_assert_redirected_to_41
Fix regression on `assert_redirected_to`, 4-1-stable
bde50be
@rafaelfranca rafaelfranca Merge pull request #15094 from gsamokovarov/patch-1
Remove falsy deprecation note in AS guides [ci skip]
6eee9e5
@rafaelfranca rafaelfranca Merge pull request #15072 from mjtko/fix/issue-15064
[Fixes #15064] Calling number_to_delimited on a ActiveSupport::SafeBuffer results in mangled output
Conflicts:
	activesupport/CHANGELOG.md
04dbeca
Commits on May 14, 2014
@matthewd matthewd Merge pull request #14833 from jyao6/attribute_inheritance
Fixed Attribute Inheritance Issue
0ac1632
@rafaelfranca rafaelfranca Merge pull request #15078 from nbudin/fix_merger_filter_binds_compari…
…son_master

Make filter_binds filter out symbols that are equal to strings

Conflicts:
	activerecord/CHANGELOG.md
28c6342
Commits on May 15, 2014
@rafaelfranca rafaelfranca Merge pull request #14871 from kassio/kb-fixes-namespaced-habtm
Fix how to compute class name on habtm namespaced.

Conflicts:
	activerecord/CHANGELOG.md
bc67969
@pixeltrix pixeltrix Add missing requires for require 'action_dispatch/routing'
(cherry picked from commit ee8dc39)
31599ea
@matthewd matthewd Merge pull request #14791 from asn62/mysql_double_bug
Changed extract_limit in class Column to return correct mysql float and
double limits
5fa2391
@rafaelfranca rafaelfranca Merge pull request #15118 from khelben/head_with_status_action_stack_…
…level_too_deep

fixes stack level too deep exception on action named 'status' rendering 'head :ok'

Conflicts:
	actionpack/CHANGELOG.md
756baf2
Commits on May 16, 2014
@rafaelfranca rafaelfranca Generate the cookies_serializer configuration with :marshal when upgr…
…ading

We were generating this configuration with :json what may break
applications upgrating from Rails 4.0-.

Now we always generate with a safer value and people is free to choose
hybrid if they want.

We don't generate with hybrid by default because there are some cases
that can fail. These cases are explained on the upgrading guide.
ffb702c
@rafaelfranca rafaelfranca foo :bomb: dc81805
Commits on May 17, 2014
@rafaelfranca rafaelfranca Merge pull request #15037 from roccoblues/fix_duplicate_activesupport…
…_subscribers

Fixed duplicate subscribers in ActiveSupport::Subscriber

Conflicts:
	activesupport/CHANGELOG.md

Conflicts:
	activesupport/CHANGELOG.md
f58cc8e
@rafaelfranca rafaelfranca New applications should be created with json serializer
The fix introduced at 75ba742 were
missing this case.

To fix the original issue mentioned at that commit the correct is to
remove update_config_files from the command list since we should not run
both config_files command when creating a new application.

Tests were added to make sure everything is working fine.
628e4c5
@zzak zzak Document method visibility for designing API docs. [ci skip] 74b94de
@guilleiguaran guilleiguaran Our test suite isn't ready to run in random order yet :cry: 656bc9a
Commits on May 18, 2014
@tenderlove tenderlove Feature detect based on Ruby version.
I didn't want to do this, FNM_EXTGLOB is defined on 2.1.x, but Dir.glob
returns the wrong value on Ruby less than 2.2.0.  Checking for a
case-insensitive FS seems too hard, so just check Ruby version  Checking
for a case-insensitive FS seems too hard, so just check Ruby version.
d7b9eea
Commits on May 19, 2014
@rafaelfranca rafaelfranca Merge pull request #10798 from jcxplorer/fix-enable_extension-with-ta…
…ble_name_prefix

Fix migrations that use enable_extension with table_name_prefix/suffix

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/migration.rb

Conflicts:
	activerecord/CHANGELOG.md
41a8827
Commits on May 20, 2014
@senny senny docs, `instantiate` expects `String` keys. [Rafal Piekarski & Yves Senn]
Closes #15122
Closes #15107

Conflicts:
	activerecord/test/cases/persistence_test.rb
748cc75
@senny senny Merge pull request #15192 from simi/guides-binstubs
Use generated binstubs in guides examples. [ci skip]
1822f95
@matthewd matthewd Merge pull request #14965 from eric-chahin/issue_14824
Fixed the inferred table name of a HABTM auxiliar

Conflicts:
	activerecord/CHANGELOG.md
f88d087
@tenderlove tenderlove fix multiple hash preloads. Fixes #14994 116c23d
@rafaelfranca rafaelfranca Test with ruby-head to make @tenderlove happy cea5523
@rafaelfranca rafaelfranca Merge pull request #11346 from tomykaira/fix_10257
Check authentication scheme in Basic auth
6964b7d
@rafaelfranca rafaelfranca Copy-edit at the CHANGELOGS [ci skip] c8ddb61
Commits on May 21, 2014
@rafaelfranca rafaelfranca Merge pull request #14544 from jefflai2/named_scope_sti
Fixes Issue #13466.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
eed1e25
@rafaelfranca rafaelfranca Merge pull request #10887 from sakuro/deep_transform_keys_in_nested_a…
…rrays

Hash#deep_*_keys(!) recurse into nested arrays.

Conflicts:
	activesupport/CHANGELOG.md

Conflicts:
	activesupport/CHANGELOG.md
6f24aa2
@senny senny Merge pull request #14855 from laurocaetano/fix_polymorphic_with_stri…
…ng_key

Fix polymorphic eager load with foreign_key as String.

Conflicts:
	activerecord/CHANGELOG.md
9bfe051
@senny senny build fix, use lambda syntax that ruby 1.9.3 understands. 25a2387
@rafaelfranca rafaelfranca Revert "Merge pull request #14544 from jefflai2/named_scope_sti"
This reverts commit eed1e25.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/models/comment.rb

This change break integration with activerecord-deprecated_finders so
I'm reverting until we find a way to make it work with this gem.
1aef6ee
Commits on May 22, 2014
@matthewd matthewd Merge pull request #14803 from kuldeepaggarwal/null_relation_sum_fix
Fixed a problem where `sum` used with a `group` was not returning a Hash.

Conflicts:
	activerecord/CHANGELOG.md
1df087f
@rafaelfranca rafaelfranca Merge pull request #14613 from Sirupsen/fix-serialize-update-column
Fix serialized field returning serialized data after update_column

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
3a00c6f
Commits on May 23, 2014
@senny senny Merge pull request #15251 from peeyushsingla/master
Reorder query in active record query of rails guide [ci skip]
Conflicts:
	guides/source/active_record_querying.md
f1c9af7
@rafaelfranca rafaelfranca Remove warning removing the method before redefining
We need to test if the same method defined more than once only register
one subscriber for it. We can safelly remove because the method body is
the same and Subscriber use method_added hook for register the
subscriber.
e180249
@guilleiguaran guilleiguaran Merge pull request #14850 from chancancode/fix_json_cookie_jar
Fixed an issue with migrating legacy json cookies.
Conflicts:
	actionpack/CHANGELOG.md
b6b65ff
@tenderlove tenderlove Merge pull request #15240 from chancancode/fix_attribute_methods
Fixed serialization for records with an attribute named `format`.
Conflicts:
	activerecord/CHANGELOG.md
0f86846
@senny senny doc, pg `hstore` and `json` columns are mapped as `Hash`. [ci skip]
Closes #15141.
47a60ea
@zzak zzak Remove the assignment for real this time.
cc:
a11e2fc#commitcomment-6353614
and 0369dbf

Conflicts:
	activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb
928a0c6
@rafaelfranca rafaelfranca Merge pull request #15287 from zzak/backport_14871
Backport 14871
78169e1
@arthurnn arthurnn Add has_and_belongs_to_many back to reflections hash.
This adds back `has_and_belongs_to_many` reflection to the reflections
hash. Even thought we are not using that internally, as
`Model.reflections` is a public method we need to keep the hash of
reflections coherent.

ad7b5ef is the commit that made
has_and_belongs_to_many became a has_many :through and a has_many.

[fixes #14682]
bb6861d
@arthurnn arthurnn Small test syntax change 8c169c4
@arthurnn arthurnn Replace reflect_on_all_associations internally 605e253
@arthurnn arthurnn Add _reflect_on_association method for internal use
Internally we wanna look-up the reflection by the association name in
the private list of reflections, so I am adding a
_reflect_on_association method that does that.
5657f5f
@arthurnn arthurnn Make HasManyThroughSourceAssociationNotFoundError use _reflections
- No need to use .map(:to_s)
- Add @api public to reflections
f625f78
@arthurnn arthurnn Add changelog for #15210 8bcaa81
@guilleiguaran guilleiguaran Update CHANGELOG.md
Fix typo
2922417
@zzak zzak Backport tests from 43f5250 eb92b6c
Commits on May 24, 2014
@rafaelfranca rafaelfranca Merge pull request #15292 from zzak/backport_43f525031ad3f83a04f84e79…
…bbe1de340bf937aa

Backport 43f5250
d40287d
@kemper kemper Don't recurse infinitely when calling non-existent method on super 7bc16e3
@tenderlove tenderlove fix test from 7537057 372f7a6
@rafaelfranca rafaelfranca Merge pull request #15210 from arthurnn/fix_hbtm_reflection
Fix habtm reflection
7b912a0
@rafaelfranca rafaelfranca Revert "Merge pull request #15292 from zzak/backport_43f525031ad3f83a…
…04f84e79bbe1de340bf937aa"

This reverts commit d40287d, reversing
changes made to 2922417.

These tests are already there
5920d58
@rafaelfranca rafaelfranca Merge pull request #14986 from dlangevin/trailing-slash-url-generation
Fixes URL generation with trailing_slash: true

Conflicts:
	actionpack/lib/action_dispatch/http/url.rb

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_dispatch/http/url.rb
f83ca9a
@rafaelfranca rafaelfranca Merge pull request #9083 from bronson/patch-1
avoid using alias in generators
c9ff9d1
@rafaelfranca rafaelfranca Add FIXME note about the thor bug a8de5b3
@fxn fxn integration tests do not need to load fixtures by hand
I don't know when this changed, checked back up to 3.2 and integration
tests instantiate fixtures just fine.
e697e02
@JohnKellyFerguson JohnKellyFerguson Update all Rails 4.1.0 references in guides to 4.1.1 [ci skip]
Conflicts:
	guides/CHANGELOG.md
	guides/code/getting_started/Gemfile
	guides/source/debugging_rails_applications.md
45c5f43
@zzak zzak Reference 4.1.1 in debugging rails applications guide from #15304 c237861
Commits on May 26, 2014
@rafaelfranca rafaelfranca Escape user input before showing in the page.
This is not a security issue since this page is not present in
production and user have to type something in the field but is better to
escape the input.
a432b36
@arthurnn arthurnn Refactoring .reflections public method.
Now the internal reflections will hold a reference to its public
representation, so when the outside world calls `Account.reflection` we
can build a list of public reflections.

Conflicts:
	activerecord/lib/active_record/associations.rb
	activerecord/lib/active_record/counter_cache.rb
	activerecord/lib/active_record/reflection.rb
64c7fa1
Commits on May 27, 2014
@rafaelfranca rafaelfranca Merge pull request #15301 from zzak/issue_15212
Skip if the association was already loaded.
b2d915a
@rafaelfranca rafaelfranca Add test case for b13d260 445423d
@rafaelfranca rafaelfranca Move test to the proper file
All preload tests are in the eager_test file
c2af3b6
@zzak zzak Fix syntax error from 5eae77c 315f51b
@rafaelfranca rafaelfranca Merge pull request #15358 from arthurnn/redefine_habtm_fix
Fix redefine a has_and_belongs_to_many inside inherited class
Conflicts:
	activerecord/CHANGELOG.md
8cb48ab
@rafaelfranca rafaelfranca Fix the changelog task bc41bda
@rafaelfranca rafaelfranca Preparing for 4.1.2.rc1 release fcb1afc
Commits on May 28, 2014
@senny senny Revert "Merge pull request #12778 from etehtsea/rake-default-fix"
This reverts commit 38cf00e.

Conflicts:
	railties/CHANGELOG.md
90c028b
@zzak zzak Upgrading Ruby on Rails guide is no longer WIP [ci skip] e8330c6
Commits on Jun 04, 2014
@carlosantoniodasilva carlosantoniodasilva Merge pull request #15482 from laurocaetano/fix-regression-for-eager-…
…load

Fix regression on eager loading association based on SQL query rather than existing column.

Conflicts:
	activerecord/CHANGELOG.md
a321640
Commits on Jun 09, 2014
@rafaelfranca rafaelfranca Do not try to set the foreign_key again on has_many through
Integration tests are inside protected_attributes test suite.

Fixes #15496
Fixes rails/protected_attributes#35
839c124
@rafaelfranca rafaelfranca Timestamp values should be present on callbacks
This reverts commit dd3ea17 and add a
regression test.

Fixes #15418
e9c8d28
Commits on Jun 13, 2014
@rafaelfranca rafaelfranca Merge pull request #15701 from zzak/issue_15496
Open extension point for defining options in build_through_record
277be1e
Commits on Jun 16, 2014
@rafaelfranca rafaelfranca Preparing for 4.1.2.rc2 release 5006b63
Commits on Jun 17, 2014
@jonatack jonatack 4.1.2 ActionPack CHANGELOG grammar pass [ci skip]
Sprucing it up a bit for the release.
7874548
@sgrif sgrif Merge pull request #15785 from jonatack/patch-7
4.1.2 ActionPack CHANGELOG grammar pass [ci skip]
ffdc7ab
Commits on Jun 18, 2014
@jonatack jonatack 4.1.2 ActionView CHANGELOG grammar pass [ci skip] e5220a6
@zzak zzak Merge pull request #15796 from jonatack/patch-7
 4.1.2 ActionView CHANGELOG pass [ci skip]
174bf46
Commits on Jun 19, 2014
@rafaelfranca rafaelfranca Fix has_and_belongs_to_many in a namespaced model pointing to a non n…
…amespaced model

Now the following case will work fine

    class Tag < ActiveRecord::Base
    end

    class Publisher::Article < ActiveRecord::Base
      has_and_belongs_to_many :tags
    end

Fixes #15761
1a12bee
@rafaelfranca rafaelfranca Merge pull request #15772 from nbudin/sti_through_bug
Don't include inheritance column in the through_scope_attributes
a44feed
Commits on Jun 23, 2014
@rafaelfranca rafaelfranca Preparing for 4.1.2.rc3 release 6ed0f63
Commits on Jun 26, 2014
@rafaelfranca rafaelfranca Preparing for 4.1.2 release 14f635a
@rafaelfranca rafaelfranca Point to the newest version [ci skip] 0690f6f