Merge pull request #10405 from rubys/410-beta

Make railties version match RAILS_VERSION
allow override of uuid_generate_v4() default by passing default: nil

without this, it's not possible to use UUID primary keys without uuid-ossp installed and activated
Merge pull request #10404 from chadmoone/fix-pg-uuid-default

Allow override of PostgreSQL UUID primary key default
Handle aliased attributes in ActiveRecord::Relation.

When using symbol keys, ActiveRecord will now translate aliased attribute names to the actual column name used in the database:

With the model

  class Topic
    alias_attribute :heading, :title
  end

The call

  Topic.where(heading: 'The First Topic')

should yield the same result as

  Topic.where(title: 'The First Topic')

This also applies to ActiveRecord::Relation::Calculations calls such as `Model.sum(:aliased)` and `Model.pluck(:aliased)`.

This will not work with SQL fragment strings like `Model.sum('DISTINCT aliased')`.

Github #7839

*Godfrey Chan*
use constant for encoding
Merge pull request #10407 from NARKOZ/encoding-constant

Use constant for encoding
Improve docs for postgresql with uuid primary keys [ci skip]

Introduced in 09ac1776abc0d3482f491f2d49f47bcb3d9a4ad7.
Merge pull request #7839 from chancancode/handle_aliased_attributes_in_ar_relation

Handle aliased attributes in AR::Relation
Convert ActiveModel to 1.9 hash syntax.

I also attempted to fix other styleguide violations such as
{ a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
Merge pull request #10408 from patricksrobertson/convert_activemodel_to_new_hash_syntax

Convert ActiveModel to 1.9 hash syntax.
Extract tests code out from AR's base_test.rb to integration_test.rb

`AR::Base#to_param` and `AR::Base#cache_key` is defined at
active_record/integration.rb, so tests for those methods should be at
integration_test.rb
Merge pull request #10396 from tkhr/extract-test-code-from-base_test.rb

Extract tests code out from AR's base_test.rb to integration_test.rb
Fix failures in AS with minitest 4.7.4
Remove not used module from initializable test
Use faster Array.new instead of []*padding
Fix typo in test
Fixes Dependency bug in Active Support

DateTime defined in date.rb
destroys association records before saving/inserting new association records

fixes bug introduced by  #3329
These are the conditions necessary to reproduce the bug:
- For an association, autosave => true.
- An association record is being destroyed
- A new association record is being created.
- There is a unique index one of the association's fields.
- The record being created has the same value as the record being
destroyed on the indexed field.

Before, the deletion of records was postponed until after all
insertions/saves.  Therefore the new record with the identical value in
the indexed field caused a non-unique value error to be thrown at the database
level.

With this fix, the deletions happen first, before the insertions/saves.
Therefore the record with the duplicate value is gone from the database
before the new record is created, thereby avoiding the non-uniuqe value
error.
Merge pull request #10414 from eiel/fix_dependency

Fixes Dependency bug in Active Support
Merge pull request #10412 from vipulnsward/fix_callback_test_typo

Fix typo in test