Backport 5c51cd0: #send_file leans on Rack::Sendfile to X-Accel-Redirect the file's path, so opening the file to set the response body is wasteful. Set a FileBody wrapper instead that responds to to_path and streams the file if needed.
Do not use update_column where update_attribute is not interchangeable

Revert "Deprecate update_attribute."

This reverts commit b081f6b59fb3f15d12043072ad9b331ffd2bc56e.

Reason: Since the new deprecation policy we removed the deprecation of
update_attribute but we didn't reverted the changes to use
update_column.

Fixes #7306
Merge pull request #7027 from erichmenge/patch/jruby_send_file

Backport 5c51cd0 to fix an issue with jRuby encodings. Fixes #6844
Remove duplicated changelog entry [ci skip]
Use benchmark/ips to measure AR performance

This means we can more easily compare numbers, and we don't have to
specify a single N for all reports, which previously meant that some
tests were running many more/fewer iterations than necessary.
Increase benchmark time to 20 seconds.

I think that 5 seconds was a bit low for our purposes.

Also enable it to be configured via env vars.

We also need to scale the number of records up/down depending on how
long we're running the benchmark for.
Merge pull request #7352 from aripollak/microsecond-timestamp

Fix occasional microsecond conversion inaccuracy
Conflicts:
	activerecord/CHANGELOG.md
Ruby 1.8 doesn't have to_r defined to NilClass and Float.

Use round to get the right conversion
Table#remove passed an array to remove_column, which is deprecated.

See 02ca9151a043a4fefbb3f22edd05f0cd392fffaa
Merge pull request #7388 from ManageIQ/fix_table_remove_passing_array_deprecation

Table#remove passed an array to remove_column, which is deprecated.
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