Fix: habtm doesn't respect select query method.

Patch for issue #2923.
Merge pull request #3102 from hone/3-1-stable

Bump sqlite3 in Gemfile to 1.3.4
set env to let rails know we're precompiling
Merge pull request #3103 from hone/precompile_flag

set env to let rails and co. (read gems) know we're precompiling
Merge pull request #3092 from asee/master

Sprockets to use config.assets.prefix, with tests
Merge pull request #3115 from guilleiguaran/refactor-rails-helpers

Remove Sprockets compute_public_path, AV compute_plubic_path can be used
`rake assets:precompile` loads the application but does not initialize it.

To the app developer, this means configuration add in
config/initializers/* will not be executed.

Plugins developers need to special case their initializers that are
meant to be run in the assets group by adding :group => :assets.
Remove the ENV flag, yagni.
Add test for belongs_to? and group initializers.
Avoid using pathnames and automatically create the manifest directory if one does not exist yet.
Fix spacing on Gemfile.
Re-launch assets:precompile task using (Rake.)ruby instead of Kernel.exec so it works on Windows

The Kernel.exec method launches the current program ($0) after setting some environment variables.  This current ruby script has a shebang line and no .rb in its name. Launching a script this way does not work on Windows. By using the +ruby+ method that is included in Rake, we can launch the current script with the current ruby version and bypass the identified Windows issue.
Revert "Make process reuse the env var passed as argument"

This reverts commit 0e4748cd415660eb91e63d50aa15cdd027c612dd.
Merge pull request #3121 from cablegram/3-1-stable

Re-launch assets:precompile task using (Rake.)ruby instead of Kernel.exec so it works on Windows
Merge pull request #3123 from avakhov/patch-5-remove-superfluous-to-s

remove superfluous to_s in ERB::Util.html_escape
escape options for the stylesheet_link_tag method

Signed-off-by: José Valim <jose.valim@gmail.com>
CollectionProxy#replace should change the DB records rather than just mutating the array. Fixes #3020.

Conflicts:

	activerecord/test/cases/associations/has_many_associations_test.rb
remove stray line
Add deprecation for the preload_associations method. Fixes #3022.
image_tag should use /assets if asset pipelining is turned on. Closes #3126