remove the reflection delegate
clean up add_constraints signature
pass the tracker down the stack and construct it in the scope method
pass the association and connection to the scope method
make a singleton for AssociationScope

AssociationScope no longer maintains state, so we're safe to keep a
singleton and save on GC time
make most parameters to the AliasTracker required

This helps with our sanity.  The class is internal, we can refactor to a
"nice" API later.
stop exposing table_joins
guarantee a list in the alias tracker so we can remove a conditional
add factory methods for empty alias trackers

If we know the alias tracker is empty, we can create one that doesn't
use a hash with default block for counting.

ActiveRecord::Base.establish_connection(adapter: 'sqlite3',
                                        database: ':memory:')

ActiveRecord::Schema.define do
  create_table :posts, force: true do |t|
    t.integer :comments_count
  end

  create_table :comments, force: true do |t|
    t.integer :post_id
  end
end

class Post < ActiveRecord::Base; has_many :comments; end
class Comment < ActiveRecord::Base; belongs_to :post, counter_cache: true; end
10.times { Comment.create!(post: Post.create!) }

record = Post.first
association_name = :comments

Benchmark.ips do |x|
  reflection = record.class.reflect_on_association(association_name)
  association = reflection.association_class.new(record, reflection)
  x.report('assoc') do
    reflection.association_class.new(record, reflection)
  end
  x.report('reader') do
    association.reader;nil
  end
  x.report('combined') do
    reflection.association_class.new(record, reflection).reader;nil
  end
end

[aaron@higgins rails (tracker)]$ TEST=ips bundle exec ruby ../1bb5456b5e035343df9d/gistfile1.rb
-- create_table(:posts, {:force=>true})
   -> 0.0062s
-- create_table(:comments, {:force=>true})
   -> 0.0003s
Calculating -------------------------------------
               assoc       833 i/100ms
              reader     28703 i/100ms
            combined       839 i/100ms
-------------------------------------------------
               assoc     9010.3 (±3.8%) i/s -      44982 in   5.000022s
              reader  3214523.4 (±5.5%) i/s -   16016274 in   5.001136s
            combined     8841.0 (±5.8%) i/s -      44467 in   5.049269s

[aaron@higgins rails (tracker)]$ TEST=ips bundle exec ruby ../1bb5456b5e035343df9d/gistfile1.rb
-- create_table(:posts, {:force=>true})
   -> 0.0060s
-- create_table(:comments, {:force=>true})
   -> 0.0003s
Calculating -------------------------------------
               assoc       888 i/100ms
              reader     29217 i/100ms
            combined       900 i/100ms
-------------------------------------------------
               assoc     9674.3 (±3.3%) i/s -      48840 in   5.054022s
              reader  2988474.8 (±6.9%) i/s -   14842236 in   4.998230s
            combined     9674.0 (±3.1%) i/s -      48600 in   5.028694s
implements new option :month_format_string for date select helpers [Closes #13618]
Revert "Fixed plugin_generator test"

This reverts commit fefa8ae9a172835fb6b8aef7d1dd46d58eecd49f.
Merge pull request #14069 from arunagw/aa-plugin-generator-build-fix

Revert "Fixed plugin_generator test"

As this commit  22a1a5ac8c4631f29cfeac451c361e8da1dd2261 has reverted all changes so this plugin generator also needs to fix.
Add a missing changelog entry for #13981 and #14035

[ci skip]
Correct prestreaming controller response status.

if the controller action has not yet streamed any data, actions should
process as normal, and errors should trigger the appropriate behavior
(500, or in the case of ActionController::BadRequest, a 400 Bad Request)
Merge pull request #14072 from robin850/patch-16

Add a missing changelog entry for #13981 and #14035
Merge pull request #13937 from ktaragorn/guides_fixes

Guides fixes
Resolve encoding issues with arrays of hstore (bug 11135).

We didn't have enough encoding for the wire protocol to store an array
of hstore types. So, further encode any hstore that is an array member.
Whilst we're here, ensure it's an HashWithIndifferentAccess being
returned, to be consistent with other serialized forms, and add testing
for arrays of hstore.

So now the following migration:

  enable_extension "hstore"
  create_table :servers do |t|
    t.string  :name
    t.hstore  :interfaces, array: true
  end

produces a model that can used like this, to store an array of hashes:

  server = Server.create(name: "server01", interfaces: [
    { name: "bge0", ipv4: "192.0.2.2", state: "up" },
    { name: "de0", state: "disabled", by: "misha" },
    { name: "fe0", state: "up" },
  ])

More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
Merge pull request #13512 from gsamokovarov/hstore_arrays_fix

Hstore arrays fix (follow up for #11444)
Fix typo [ci skip]
Don't skip tests if they are not broken. Just don't define they