Revert "Merge pull request #9252 from senny/8423_hmt_preloading_bug"

This reverts commit c5451777b038c5e48567f69256986ae42a2cde48.

Conflicts:
	activerecord/CHANGELOG.md
Update activemodel/CHANGELOG.md

Fixed a typo
Merge pull request #9308 from joernchen/patch-1

Update activemodel/CHANGELOG.md
Fix handling of dirty time zone aware attributes

Previously, when `time_zone_aware_attributes` were enabled, after
changing a datetime or timestamp attribute and then changing it back
to the original value, `changed_attributes` still tracked the
attribute as changed. This caused `[attribute]_changed?` and
`changed?` methods to return true incorrectly.

Example:

    in_time_zone 'Paris' do
      order = Order.new
      original_time = Time.local(2012, 10, 10)
      order.shipped_at = original_time
      order.save
      order.changed? # => false

      # changing value
      order.shipped_at = Time.local(2013, 1, 1)
      order.changed? # => true

      # reverting to original value
      order.shipped_at = original_time
      order.changed? # => false, used to return true
    end

(cherry picked from commit bc982cbcb34129ea2cfe8aa1f8e0b40e444e68db)

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb

Backport of #9073
Fixes #8898
Allow failures to 2.0.0
don't cache invalid subsets when preloading hmt associations.

Backport #9252.

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/eager_test.rb

The preloader code on 3-2-stable is not based on relations but on option hashes.
I had to modify the original patch and comparing the option hashes could be more
fuzzy than comparing the relations. All the tests passed though.
Merge pull request #9322 from senny/backport_9252

don't cache invalid subsets when preloading hmt associations.
keep the build :green_heart:, #first on 1.8.7 and pg is different

The build only failed for ruby-1.8.7 and pg. The problem was that the statement:

```ruby
author = Author.includes(:comments_with_order_and_conditions, :posts).first
```

resulted in Author with ID 2 where on all other rubies / db-engines Author with ID 1
was retunred. Of course this breaks the assertions.
Merge pull request #9323 from senny/build_fix_from_9252

keep the build :green_heart:, #first on 1.8.7 and pg is different
Use order to get the first record since postgresql returns in the
desired order
Change tabs to spaces in form options helper [ci skip]
determine the match shorthand target early.

Backport #9361.
Closes #7554.

This patch determines the `controller#action` directly
in the `match` method when the shorthand syntax is used.
this prevents problems with namespaces and scopes.
Merge pull request #9374 from senny/improved_match_shorthand_syntax

determine the match shorthand target early.
Use 1.8 hash style
Sqlite preserves primary keys when copying/altering tables.

Backport #2312.
Fixes #9367.

I also added a test-case to make sure that renaming or removing
a column preserves the primary key.
Merge pull request #9388 from senny/9367_wrong_schema_after_remove_column

Sqlite preserves primary keys when copying/altering tables.
Fix a fixtures test case with table prefix/suffix

Make sure the table name of a model is reset in a test case after assigning ActiveRecord::Base.table_name_prefix and ActiveRecord::Base.table_name_suffix.
Use the correct table name from fixture

Fixed a bug in fixtures.rb where the table name was incorrectly inferred from the fixture path which was ambiguously called "table_name" but was also used as the fixture name.
Now, the "correct" table name is taken from an instance variable.
Test fixtures with custom model and table names

Test using fixtures with random names and model names, that is not following naming conventions but using set_fixture_class instead.

It is expected that the table name be defined in the model, but this is not explicitly tested here.  This will need to be fixed.
"foo/bar" instead of "foo_bar" keys for fixtures

This solves an issue with set_fixture_class class method caused by create_fixtures method's overwriting passed to it fixture model classes, when the fixtures are "namespased": foo/bar or admin/users.

The idea is to use "foo/bar" string as the name and identifier of a
fixture file bar in directory foo.  The model class of the fixture is either set with set_fixture_class method, or otherwise inferred from its name using camelize method.

Also a bug is fixed in lines 487-489 when the table names were guessed by substitution from the fixture file names, ambiguously called  table_names, instead of being taken from fixture attributes.  Now they are taken from attributes.

Add a method `ActiveRecord::Fixtures.default_fixture_model_name` instead of a ":nodoc:" class method `ActiveRecord::Fixtures.find_table_name`, which does not correspond to its name.  The old method name is aliased to the new one, and is deprecated in master in favour of the new one.