Merge pull request #7377 from brainopia/use_inversed_parent_for_first_and_last_child

Use inversed parent for first and last child of has_many association

[Backport] Closes #3223.

Conflicts:
	activerecord/lib/active_record/associations/collection_association.rb
Merge pull request #6986 from kennyj/fix_6975

Fix #6975. Round usec when writing timestamp attribute.

Conflicts:
	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
Merge pull request #7410 from sandeepravi/default_options_helper_value

option_tags coerced to "" instead of nil

Closes #7404
Merge pull request #5210 from Pliny/masteri

Fix for #5200

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/counter_cache.rb
Use a model without counter cache to test read-only attributes
Use Ruby 1.8 hash syntax

Introduced in backport 648c5a1369ed64608c3ca43a5ebc917687d20010.
We need to have 1-0-stable for joureny gem in edge

Problem : Edge rails can't bundle
Fixes #7437
Merge pull request #7438 from arunagw/3-2-stable-edge-rails-fix

We need to have 1-0-stable for joureny gem in edge
correct handling of date selects when using both disabled and discard options

we should take disabled option not only from `html_options` hash but from
`options` hash too like `build_select` method does it. So

datetime_select("post", "updated_at", { :discard_minute => true }, { :disabled => true })
datetime_select("post", "updated_at", :discard_minute => true , :disabled => true)

both these variants work now

closes #7431
Merge pull request #7446 from nashby/backport-fix-issue-7431

backport #7435
fixes a bug in dependencies.rb

loaded stores file names without the .rb extension, but search_for_file
returns file names with the extension.

The solution is hackish, but this file needs a revamp.
CHANGELOGs are now per branch

Check 810a50d for the rationale.
Ensure association preloading properly merges default scope and association conditions

Conflicts:

	activerecord/test/models/reader.rb
Fix bug when Rails.application is defined but is nil. See #881
Merge pull request #7474 from steveklabnik/backport_89ebd28

Backport 89ebd28 to 3-2-stable
documents after_(commit|rollback)
set the configured #inheritance_column on #become (#7503)

I had to create a new table because I needed an STI table,
which does not have both a "type" and a "custom_type"

the test fails with:
  1) Error:
test_alt_becomes_works_with_sti(InheritanceTest):
NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber">
    /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing'
    /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing'
    /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes'
    test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti'
    test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'

Conflicts:

	activerecord/test/cases/inheritance_test.rb
Merge pull request #7514 from senny/issue_7503_3_2_stable

set the configured #inheritance_column on #become (#7503)
Merge pull request #7337 from adzap/string_to_dummy_time

Fix for time type columns with invalid time value
Conflicts:
	activerecord/CHANGELOG.md
Update Active Model xml serialization test to reflect a change in builder

Due to a change in builder, nil values and empty strings now generates
closed tags, so instead of this:

    <pseudonyms nil=\"true\"></pseudonyms>

It generates this:

    <pseudonyms nil=\"true\"/>

Document this change in Rails so that people can track it down easily if
necessary.

Conflicts:
	activemodel/CHANGELOG.md