Merge branch 'master' into adequaterecord

* master: (311 commits)
  Add a missing changelog entry for #13981 and #14035
  Revert "Fixed plugin_generator test"
  implements new option :month_format_string for date select helpers [Closes #13618]
  add factory methods for empty alias trackers
  guarantee a list in the alias tracker so we can remove a conditional
  stop exposing table_joins
  make most parameters to the AliasTracker required
  make a singleton for AssociationScope
  pass the association and connection to the scope method
  pass the tracker down the stack and construct it in the scope method
  clean up add_constraints signature
  remove the reflection delegate
  remove klass delegator
  remove railties changes. fixes #14054
  remove chain delegate
  remove scope_chain delegate
  Add verb to sanitization note
  fix path shown in mailer's templates
  updated Travis build status image url
  fix guide active_support_core_extensions. add Note to String#indent [ci skip]
  ...

Conflicts:
	activerecord/lib/active_record/associations/join_dependency.rb
	activerecord/test/cases/associations/association_scope_test.rb
Merge branch 'master' into adequaterecord

* master:
  Revert "Merge pull request #13344 from ccutrer/fix-from-default-select"
  No need to use symbols
  Don't skip tests if they are not broken. Just don't define they
  Fix typo [ci skip]
  Resolve encoding issues with arrays of hstore (bug 11135).
  Fix coffeescript sample [ci skip]
add AST cache to the find_by method
cache queries in the Model.find(id) path
Merge branch 'master' into adequaterecord

* master: (32 commits)
  Typo fix for unscope
  Use the reference for the mime type to get the format
  Preparing for 4.1.0.beta2 release
  Correctly escape PostgreSQL arrays.
  Escape format, negative_format and units options of number helpers
  Sync 4.1 release notes with changes since 7f648bc7 [ci skip]
  Update upgrading guide regarding `render :text`
  Add `#no_content_type` attribute to `AD::Response`
  Add missing CHANGELOG entry to Action View
  Update guides for new rendering options
  Cleanup `ActionController::Rendering`
  Fix a fragile test on `action_view/render`
  Introduce `render :html` for render HTML string
  Introduce `render :plain` for render plain text
  Update hash format for render_text_test
  Introduce `render :body` for render raw content
  Don't use `# =>` when it is not the expression values
  Fix the column name [ci skip]
  Document the default scopes change on the release notes, CHANGELOG and upgrating guides
  Move changelog entry to the top, fix examples indent [ci skip]
  ...
[Active Record] Renamed private methods create_record and update_record

 This is to ensure that they are not accidentally called by the app code.
 They are renamed to _create_record and _update_record respectively.
 Closes #11645
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
Merge branch 'master' into adequaterecord

* master: (55 commits)
  [ci skip] Move association class method notes
  extract common code in `uuid_test.rb`.
  move PostgreSQL UUID tests from `datatype_test.rb` to `uuid_test.rb`.
  [ci skip] remove guide section on models in migrations
  test case for custom PostgreSQL enum type.
  Remove inclusion of rubysl gem for rbx on generated Gemfile
  let `insert_record` actuall save the object.
  [skip ci] Fix test name typo in app generator tests.
  travis s/2.1.0/2.1.1
  Bump version of bcrypt gem
  Skip test_migrate_revert_add_index_with_name if databases do not allow to create duplicate indexes on the same columns
  Optimize getting started guide images, and use png instead of jpg
  :scissors: [ci skip]
  Point master changelogs to 4-1-stable branch
  Add missing parantheses in index_exists?
  `ActionDispatch::Head` was replaced by `Rack::Head`. Closes #14191.
  [skip ci] Standardized punctuation.
  [skip ci] Fix typo in link_to :method option description
  refactor, with_locale is not needed because I18n is mocked.
  Fix ActionView label translation for more than 10 nested elements
  ...
Merge branch 'master' into adequaterecord

* master:
  modify model generator warning message. refs [#174c9f0]
  Replace "data store" with database [ci skip]
  Return a hash rather than array from fetch_multi
  Fix concerning module reference [ci skip]
  Fixes docs typo in nested resource path helpers [skip ci]
  Fix some validators when used on model instance
  Pass strings to demodulize method
  pass strings to the underscore method
  speed up `underscore` in cases that don't need to do anything
  pass the class name to `tableize`
  [ci skip] Update list of files extensions in rake notes guide
  Fix controller test not resetting @_url_options
we can't cache when the arguments are a hash
Replace map.flatten with flat_map in actionpack
Replace map.flatten with flat_map in activerecord
Replace map.flatten with flat_map in railties
Make CSRF failure logging optional/configurable.

Added the log_warning_on_csrf_failure option to ActionController::RequestForgeryProtection
which is on by default.
Merge branch 'master' of https://github.com/RORLabGuides/docrails
Fix OrderedHash.select to return self instance.

On ruby 2.1.1 the behavior of .select and .reject has changed.
They will return a Hash new instance, so we need to override them to
keep the instance object class.
Add preventDefault() on click event
Merge pull request #14316 from the4dpatrick/master

Add preventDefault() on click event
Make sure we clean preview_interceptors

We should make sure we clean preview_interceptors after each test so they dont leaky to the next test
Merge pull request #14318 from arthurnn/clean_preview_interceptors

Make sure we clean preview_interceptors