Fixed STI classes not defining an attribute method if there is a
conflicting private method defined on its ancestors.

The problem is that `method_defined_within?(name, klass, superklass)`
only works correclty when `klass` and `superklass` are both `Class`es.

If both `klass` and `superklass` are both `Class`es, they share the
same inheritance chain, so if a method is defined on `klass` but not
`superklass`, this method must be introduced at some point between
`klass` and `superklass`.

This does not work when `superklass` is a `Module`. A `Module`'s
inheritance chain contains just itself. So if a method is defined on
`klass` but not on `superklass`, the method could still be defined
somewhere upstream, e.g. in `Object`.

This fix works by avoiding calling `method_defined_within?` with a
module while still fufilling the requirement (checking that the
method is defined withing `superclass` but not is not a generated
attribute method).

4d8ee288 is likely an attempted partial fix for this problem. This
unrolls that fix and properly check the `superclass` as intended.

Fixes #11569.
Bump version of bcrypt gem
travis s/2.1.0/2.1.1
Merge pull request #14199 from arthurnn/travis_211

travis s/2.1.0/2.1.1
Merge remote-tracking branch 'chancancode/fix_instance_method_already_implemented'

Conflicts:
	activerecord/CHANGELOG.md
[skip ci] Fix test name typo in app generator tests.
Merge pull request #14200 from spencer1248/fix_typo_in_app_generator_test_name

Fix test name typo in app generator tests.
let `insert_record` actuall save the object.

`before_add` callbacks are fired before the record is saved on
`has_and_belongs_to_many` assocations *and* on `has_many :through`
associations.  Before this change, `before_add` callbacks would be fired
before the record was saved on `has_and_belongs_to_many` associations, but
*not* on `has_many :through` associations.

Fixes #14144
Remove inclusion of rubysl gem for rbx on generated Gemfile

From #14026:

    Specific rbx-2 to limit testing on Rubinius 2.x (since there will be
    other versions of Rubinius > 2.x soon).

    Also, as of Rubinius 2.2.5, it is no longer necessary to bundle the
    rubysl gem.

This is what Rails master/4.1 supports, so we don't need to add rubysl to
gemfiles anymore.
Merge pull request #14149 from tjschuck/bcrypt_gem_rename

Bump version of bcrypt gem
test case for custom PostgreSQL enum type.

This test currently outputs the following warning:

```
unknown OID: current_mood(3567879) (SELECT  "postgresql_enums".* FROM "postgresql_enums"   ORDER BY "postgresql_enums"."id" ASC LIMIT 1)
unknown OID: current_mood(3567879) (SELECT  "postgresql_enums".* FROM "postgresql_enums"  WHERE "postgresql_enums"."id" = $1 LIMIT 1)
```

We have an open PR to deal with this issue. It will dynamically
register the OID for enum columns. This test case is merely to exhibit
the current behavior of PostgreSQL enum columns.
[ci skip] remove guide section on models in migrations

Both examples given are incorrect, and no one can seem to come up with
a realistic situation where this is an actual problem. For now, it seems like
the best thing to do is just scrap the section altogether.
Merge pull request #14208 from lukesteensen/remove-migration-example

[ci skip] remove guide section on models in migrations [ci skip]
Avoid namespacing routes inside engines

Since #11544, invoking the controller generator, any generated route is
namespaced according to the class_path method. Since a mountable plugin
is namespaced, creating a controller inside would generate a namespaced
route based on the engine's name.

The controller generator now relies on regular_class_path which does not
contain the class hierarchy but the given path.

Fixes #14079.
move PostgreSQL UUID tests from `datatype_test.rb` to `uuid_test.rb`.
extract common code in `uuid_test.rb`.
[ci skip] Move association class method notes

Make explanation of association class methods clearer by moving notes to beginning of each example section.
Merge pull request #14211 from loganhasson/master

[ci skip] Move association class method notes
Fix controller test not resetting @_url_options

Commit 4f2cd3e9 introduced a bug by reordering the call to
`@controller.recycle!` above the call to `build_request_uri`. The
impact of this was that the `@_url_options` cache ends up not being
reset between building a request URI (occurring within the test
controller) and the firing of the actual request.

We encountered this bug because we had the following setup:

  class MinimumReproducibleController < ActionController::Base
    before_filter { @param = 'param' }

    def index
      render text: url_for(params)
    end

    def default_url_options
      { custom_opt: @param }
    end
  end

  def test_index
    get :index # builds url, then fires actual request
  end

The first step in  `get :index` in the test suite would populate the
@_url_options cache. The subsequent call to `url_for` inside of the
controller action would then utilize the uncleared cache, thus never
calling the now-updated default_url_options.

This commit fixes this bug calling recycle! twice, and removes a call
to set response_body, which should no longer be needed since we're
recycling the request object explicitly.
[ci skip] Update list of files extensions in rake notes guide