Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rails/rails
...
head fork: rails/rails
This comparison is big! We’re only showing the most recent 250 commits
Commits on Nov 09, 2012
@carlosantoniodasilva carlosantoniodasilva Remove not used load hooks for active_record_config
These were removed with ActiveRecord::Model in
9e4c41c#L15L156
9622b3f
@steveklabnik steveklabnik Deprecate Hash#diff.
It's no longer used in Rails any more.

See #8142 for more
88d59de
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8158 from steveklabnik/deprecate_diff
Deprecate Hash#diff.
e56b890
@ccarruitero ccarruitero change rdoc syntax for adecuate render [ci-skip] 0500bec
@ccarruitero ccarruitero correct link syntax [ci-skip] 477cf31
@pixeltrix pixeltrix Gracefully handle upgrading apps with mass assigment configs
Most apps upgrading from 3.x will have options for mass assigment in
their application.rb and environments/*.rb config files. Rather than
just raising a NoMethodError when copying the config, this commit
adds a warning message until either the protected_attributes gem
is installed or the relevant config options are removed.
42cfacf
@ccarruitero ccarruitero update syntax and add note about prompt use of HttpHelpers [ci-skip] d89b03a
@carlosantoniodasilva carlosantoniodasilva Use get in the redirection doc examples
get is the most common usage, and match without an explicit verb
was disallowed in 56cdc81.

[ci skip]
38411b8
Dennis Taylor Trivial documentation fix for ActiveModel::Naming comment. ba291a6
@rafaelfranca rafaelfranca Merge pull request #8162 from fimmtiu/master
Trivial documentation fix for ActiveModel::Naming comment [ci skip]
90a1721
@graywh graywh Update guides/source/rails_application_templates.md
Update function signatures for `#gem` and `#generate`.
407e7d4
@graywh graywh Update guides/source/rails_application_templates.md
Add `#environment`
dcf401e
@nikitug nikitug Keep the code related to serialization in Serialization module.
We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module.
410e887
Commits on Nov 10, 2012
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8164 from nikitug/keep_serialization_in_its_module
Keep the code related to serialization in Serialization module.
a002442
@arunagw arunagw Removing warning : assigned but unused variable c33c991
@bogdan bogdan Do not create useless database transaction when building `has_one` as…
…sociation.
3cb0f3f
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8154 from bogdan/has_one_association_performance
Remove unwanted transaction when has one association is built
e803f3a
@AvnerCohen AvnerCohen 1.9 Syntax related changes 890da51
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8165 from arunagw/warning_removed_unused_variables
Removing warning : assigned but unused variable
62039ad
@vijaydev vijaydev update turbolinks readme link [ci skip] 3a76ee4
@vijaydev vijaydev recent railties changes added to the release notes [ci skip] 8ec5166
@nicolasdespres nicolasdespres Rake test:uncommitted finds git directory in ancestors.
Sometimes your git directory is an ancestor of your application root
directory.

For example:
 ./repo/.git/
 ./repo/app/Rakefile

In this case rake test:uncommitted will be unable to detect your SCM.

This patch fixes this and add a test.
df82296
@AvnerCohen AvnerCohen 1.9 hash syntax in activesupport 8553b7a
@burningTyger burningTyger make comments fit the comment boxes (mostly) in API doc guides 46100f0
@jonleighton jonleighton Make ActiveRecord::Delegation#method_missing threadsafe
Two threads may be in method_missing at the same time. If so, they might
both try to define the same delegator method.

Such a situation probably wouldn't result in a particularly spectacular
bug as one method would probably just be overridden by an identical
method, but it could cause warnings to pop up. (It could be worse if
method definition is non-atomic in a particular implementation.)

(We will also need this mutex shortly anyway, see #8127.)
12d6d3a
@burningTyger burningTyger use em-dashes instead of two minuses in guides 8dabfbe
Commits on Nov 11, 2012
@arunagw arunagw Removing warning : ambiguous first argument 5ff5cce
@nikitug nikitug Test Hash#diff deprecation, also prevent deprecation message in AS tests 63ee59d
@spastorino spastorino Merge pull request #8170 from arunagw/warning_removed_railties
Removing warning : ambiguous first argument
c49fff9
@spastorino spastorino Merge pull request #8172 from nikitug/silent_diff_deprecation
Test Hash#diff deprecation, also prevent deprecation message in AS tests
eda34c4
@nikitug nikitug Match classes without to_s conversions.
There is no need in `value_under_case.class.to_s` conversion since case already matches classes with `Class === value_under_case`.
d2abfcb
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8173 from nikitug/match_classes_without_to_s
Match classes without to_s conversions.
f9dc917
@carlosantoniodasilva carlosantoniodasilva Remove duplicated ConnectionHandling extension in AR::Base 2f3d81c
Commits on Nov 12, 2012
@floehopper floehopper Simplify code by taking advantage of latest mocha (v0.13.0).
This only works with mocha v0.13.0 or later.

Note that this also fixes a few subtle bugs present in the current
implementation :-

* Mocha was raising a `MiniTest::Assertion` instead of a
  `Mocha::ExpectationError` as intended. The latter is not recognized by
  MiniTest as an assertion failure and so it is recorded as a test
  *error*, not a test *failure* as it ought to. This leads to
  potentially confusing output in the test results.

* Mocha verification should happen as part of the test. The verification
  of expectations is equivalent to a set of assertions. These assertions
  should happen as *part of* the test so that they have a chance to
  cause the test to fail, and not just as part of the teardown. Also if
  an assertion fails during the test, then there is no need to verify
  expectations, because only the first assertion failure is normally
  reported and all subsequent bets are off.

* Expectation verification should be counted as an assertion. Mocha
  cannot record each expectation verification as an assertion, because
  we weren't passing in an assertion counter to `#mocha_verify`.
57b333e
@vipulnsward vipulnsward Merge and add tests related to 5215 5359ad9
@senny senny `#as_json` isolates options when encoding a hash. Closes #8182
Setting options in a custom `#as_json` method had side effects.
Modifications of the `options` hash leaked outside and influenced
the conversion of other objects contained in the hash.
78dca35
@senny senny cleanup, removed whitespace from CHANGELOG d5ac280
@spastorino spastorino Debugger gem doesn't work with patchlevel < 327 0ecd464
@senny senny `#pluck` can be used on a relation with `select` clause.
Closes #7551
663d9ef
@guilleiguaran guilleiguaran Update production.rb documentation: only files in app/assets are in c…
…onfig.assets.precompile
40f5f31
@guilleiguaran guilleiguaran Update production.rb: Split long comment in two lines 8132bb6
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8184 from vipulnsward/add_merge_tests
Merge and add tests related to #5215
2a8b673
@fxn fxn depend on voloko/sdoc again
voloko/sdoc seems to be maintained again, in particular
the issues that made us fork it are resolved.
5287d36
Commits on Nov 13, 2012
@matthewrobertson matthewrobertson Updated the preformance_testing guide to reflect the fact that prof-r…
…ails no longer needs to be fetched from github
7864f83
@tenderlove tenderlove only clear caches if we are actually connected to the database 85cc712
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8185 from senny/8182_as_json_options_stick_around
`#as_json` isolates options when encoding a hash. Closes #8182
d5c4370
@tenderlove tenderlove Ruby 2.0.0 defaults source encoding to utf-8 so we need to specifical…
…ly tag this file with us-ascii
8f3f50a
@nikitug nikitug Add a regression test on #8195 ff2973a
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8180 from freerange/mocha-fixes-supporting-only-0…
….13-onwards

Simplify code by taking advantage of latest mocha (v0.13.0).
395d6b4
@carlosantoniodasilva carlosantoniodasilva Use new mocha version and add changelog entry for #8180 c940aa6
@rafaelfranca rafaelfranca Merge pull request #8201 from nikitug/regression_test_on_ar_cache_key…
…_precision

Add a regression test on #8195
12990c4
@rafaelfranca rafaelfranca Merge pull request #8176 from senny/7551_pluck_with_select
`#pluck` can be used on a relation with `select` clause (#7551)
3a33572
@nikitug nikitug Regression test for #7238 8424d0d
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8202 from nikitug/regression_test_on_dynamic_find…
…er_result

Regression test for #7238
087150d
@carlosantoniodasilva carlosantoniodasilva Assert the query result instead of checking for nothing raised 9ad8d67
@nicolasdespres nicolasdespres Add ChangeLog entry. f945178
@tenderlove tenderlove backporting Struct#to_h from ruby 2.0 8f6ce1a
@rafaelfranca rafaelfranca Merge pull request #8169 from nicolasdespres/robust_git_repository_check
Rake test:uncommitted finds git directory in ancestors.
3c5c93b
@danielvlopes danielvlopes add details on password confirmation used with has_secure_password d7536e6
Commits on Nov 14, 2012
@tenderlove tenderlove replace present? with any? to reduce dependency on AS 9a64ffc
@tenderlove tenderlove only do hash lookups on options once bf35465
@tenderlove tenderlove start using options object 95ec448
@tenderlove tenderlove use the options object in the wrapper defaults fc29bff
@tenderlove tenderlove wrap up hash conversion in the constructor df3b650
@tenderlove tenderlove attribute_names will always return a list, so just use any? 4729208
@tenderlove tenderlove move the controller class to the options object d7c7270
@tenderlove tenderlove model name is lazily evaluated in the options object 46284a1
@tenderlove tenderlove move include calculation to include method on the options object 2a51d6c
@tenderlove tenderlove lazily calculate name in the options object e5248aa
@tenderlove tenderlove asset compilation should not require a database connection e5946e0
@schneems schneems add AR deep dive video links to guides 25648ce
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8218 from DawidJanczak/form-tag-doc
[ci skip] Correct examples for form_tag helper.

Conflicts:
	actionpack/lib/action_view/helpers/form_tag_helper.rb
71922fe
@trevorturk trevorturk Use BCrypt's MIN_COST in the test environment for speedier tests 06faa6d
@rafaelfranca rafaelfranca Merge pull request #8216 from trevorturk/master
Use BCrypt's MIN_COST in the test environment for speedier tests
77edb7c
@marcandre marcandre Avoid using Integer#/, as it is redefined by the 'mathn' stdlib dc3ac35
Commits on Nov 15, 2012
@fxn fxn dependencies no longer trigger Kernel#autoload in remove_const [fixes #… bff4d8d
@rafaelfranca rafaelfranca Merge pull request #8222 from marcandre/avoid_slash
Avoid using Integer#/, as it is redefined by the 'mathn' stdlib
f732f9b
@fxn fxn let remove_constant still delete Kernel#autoload constants [rounds #8213
]

The method #remove_const does not load the file, so we
can still remove the constant.
a8c3ea9
@agis- agis- Use the more compact syntax in the example a84dd20
@agis- agis- Minor punctuation improvement in ActionController guide c15b65d
@agis- agis- Replace "name" with "author" in the Cookies example
I think doing `@comments.name` is a little confusing, just doesn't sounds right.
688d8bf
@agis- agis- Slightly improve the syntax b3a3870
@agis- agis- Wrap before & after words in quotes when they're referring to filters
Using these words without quotes (example sentence: Before filters are run) can be confusing to a newcomer.
08bf549
@agis- agis- Add a note for the example in Setting Custom Headers 168f5b1
@agis- agis- Slightly improve the syntax & grammar f76b64c
@agis- agis- Remove unecessary word 2d7ea2c
@agis- agis- Some minor fixes 763c82e
@nikitug nikitug Make XmlMini.with_backend usable with threads
`XmlMini.with_backend` now may be safely used with threads:

  Thread.new do
    XmlMini.with_backend("REXML") { rexml_power }
  end
  Thread.new do
    XmlMini.with_backend("LibXML") { libxml_power }
  end

Each thread will use it's own backend.
1fab200
@agis- agis- Add a consideration note
I believe this paragraph should move to the end as it's a little out of the scope of Rails guides.
8db41ff
@agis- agis- Some minor fixes & improvements c675922
@agis- agis- Move "Using Action View outside of Rails" at the bottom
See 8db41ff7698eed542fb09821de37fc7ea1f2bd5d why
bf63c49
@agis- agis- Improve the starting sentence c1a6614
@agis- agis- Update table of contents as a result of #bf63c4971d73e80739c9f2619a9f…
…a0dfb2223435
42707db
@rafaelfranca rafaelfranca Merge pull request #8219 from nikitug/threadsafe_xmlmini_with_backend
Make XmlMini.with_backend usable with threads

Conflicts:
	activesupport/CHANGELOG.md
cf3eb6d
@agis- agis- Minor improvements & fixes 472b25c
@agis- agis- Minor improvements & fixes 3fb67b4
@maximerety maximerety Fix AS::Concern example (current example doesn't work) d0ba816
@maximerety maximerety Fix another AS::Concern example (class_eval is already called by incl…
…uded)
2ff8881
@agis- agis- Update links to API documentation & add a TODO 90d780c
@agis- agis- Minor improvements & fixes c675482
@agis- agis- Some minor improvements f60a51f
@agis- agis- Add links to TryGit & official documentation bf9ddc4
@spastorino spastorino Merge pull request #8112 from rails/encrypted_cookies
Encrypted cookies
ef8b845
@agis- agis- Switch to 1.9 hash syntax f3b95a6
@agis- agis- Switch to 1.9 hash syntax plus minor fixes 3f8bd32
@agis- agis- Fix 'persons' to 'people' and add some whitespace 204d3af
@agis- agis- Switch to 1.9 hash syntax ba280c6
@agis- agis- Switch to 1.9 hash syntax 000121e
@agis- agis- Properly align some example comments 25ac03c
@agis- agis- Switch to 1.9 hash syntax d8596c4
@tenderlove tenderlove create fewer relation objects d5a8bdb
@tenderlove tenderlove stop passing *args to generate aliases f77beac
@tenderlove tenderlove stop hardcoding FrontBase adapter conditionals ca71bb8
@tenderlove tenderlove arel columns can be used for grouping so that "weird" column names ar…
…e usable
0803d7a
@agis- agis- Switch to 1.9 hash syntax plus minor fixes 4ce1690
@agis- agis- Switch to 1.9 hash syntax and remove unnecessary punct. 699075a
@agis- agis- Switch to 1.9 hash syntax 5e32350
@agis- agis- Switch to 1.9 hash syntax fe44565
@agis- agis- Switch to 1.9 hash syntax 75f6e45
@agis- agis- Switch to 1.9 hash syntax
I've intentionally left out some spots as they're the expected output, and since Hash#inspect yields `=>` I guess it may be confusing for beginners to see one syntax in the guide and a different one in their system.
278e073
Commits on Nov 16, 2012
@spastorino spastorino Add nodoc to DummyKeyGenerator since it's a private thing d348c43
@spastorino spastorino Add docs for CachingKeyGenerator e6e3317
@spastorino spastorino Remove extra whitespace 44f12bb
@agis- agis- Remove the ActiveRecordHelper section
Since ActionView::Helpers::ActiveRecordHelper is removed.
21ef4e1
@agis- agis- Add a consideration note and a WIP note fe66191
@kentaro kentaro Updated dependency for bundler to ~> 1.2.2 65c2d2f
@tilsammans tilsammans Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`.
This is a list of mime types where template text is not html escaped
by default. It prevents `Jack & Joe` from rendering as
`Jack &amp; Joe` for the whitelisted mime types. The default whitelist
contains text/plain.

This follows a whitelist approach where plain text templates are
not escaped, and all the others (json, xml) are. The mime type is
assumed to be set by the abstract controller.
5f189f4
@marcandre marcandre Use Integer#div instead of Integer#/ to avoid side effects from mathn 22edb66
@josevalim josevalim Merge pull request #8235 from tilsammans/dont_escape_actionmailer_whe…
…n_plaintext

Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`
4a4de56
@marcandre marcandre Simplify (and optimize) 3c4a0b2
@fxn fxn Merge pull request #8236 from marcandre/use_div
Use div
832b1e5
@agis- agis- Switch to 1.9 hash syntax & remove some parentheses when it reads nicer 85482e1
@agis- agis- Add a consideration note
regarding linking to Kindle
17fd344
@agis- agis- Switch to 1.9 hash syntax fe30769
@agis- agis- Switch to 1.9 hash syntax 6f54aac
@agis- agis- Switch to 1.9 hash syntax (guides) da7febd
@agis- agis- Switch to 1.9 hash syntax (guides) 8b178b3
@agis- agis- Remove unnecessary whitespace e7ba7c3
@agis- agis- Add link to the Application Templates guide 991b883
@agis- agis- Remove unnecessary whitespace 3ad89fc
@carlosantoniodasilva carlosantoniodasilva Fix failing template tests
Introduced in 4a4de56.
8e49fa6
@carlosantoniodasilva carlosantoniodasilva Refactor url methods a bit
Use if..else conditions instead of return guards.
Use _ for not used arguments when iterating.
Set the path variable directly instead of using an empty string and <<.
f73a05f
@carlosantoniodasilva carlosantoniodasilva Remove config.threadsafe! from production env template
Closes #8232 [ci skip]
2bad4d2
@carlosantoniodasilva carlosantoniodasilva Move changelog entry from #8235 to the top [ci skip] de20deb
@agis- agis- Update the middleware stack to reflect the current Rails output
Specifically, remove `ActionDispatch::Head` in favor of `Rack::Head`.
8be3a1a
@kentaro kentaro Depend bundler from `=> 1.2.2` to `< 2.0` 9a07996
@rafaelfranca rafaelfranca Merge pull request #8234 from kentaro/bundler-1.2.2
Updated dependency on bundler to ~> 1.2.2
8d06b62
@agis- agis- Switch to 1.9 hash syntax (guides) e258225
@agis- agis- Switch to 1.9 hash syntax (guides) d0767ce
@spastorino spastorino Remove unused config option 1acdc4d
@spastorino spastorino Remove duplicated get /foo/write_session 571b747
@spastorino spastorino Add missing env param to get_cookie 0e2bd1d
@spastorino spastorino Call get_cookie to allow the method to be overriden by subclasses d4b9a3f
@spastorino spastorino Add UpgradeSignatureToEncryptionCookieStore
This allows easy upgrading from the old signed Cookie Store <= 3.2
or the deprecated one in 4.0 (the ones that doesn't use key derivation)
to the new one that signs using key derivation
8eefdb6
@vijaydev vijaydev Revert "add AR deep dive video links to guides"
This reverts commit 25648ce.
2b5b36e
@vijaydev vijaydev Revert "Switch to 1.9 hash syntax"
This reverts commit d8596c4.

Reason: too many mistakes [ci skip]
47411cc
@vijaydev vijaydev remove kindle link from guides index [ci skip] 578eba0
@vijaydev vijaydev copy edits and fixes [ci skip] 1fd008c
@vijaydev vijaydev Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_dispatch/routing/redirection.rb
7b70eee
@vijaydev vijaydev Remove old comments about using our own sdoc fork [ci skip] 5d239ac
@spastorino spastorino Improve UpgradeSignatureToEncryptionCookieStore docs
I suck at English, please help me reviewing this <3 <3 <3
[ci skip]
d56cfad
@yahonda yahonda Revert "mysql does not build on Ruby 2.0.0 at the moment"
This reverts commit 8d8fd13.

mysql 2.8.1 gem can be built on ruby 2.0.0-preview1.
9c82522
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8244 from yahonda/mysql_ruby200
Now mysql gem can be built on ruby 2.0.0-preview1
1e9522c
@georgebrock georgebrock Test for has_many bug on unsaved records
See issue #7950.
3e64859
@carlosantoniodasilva carlosantoniodasilva Fix some AR changelog entries [ci skip] 7411970
Commits on Nov 17, 2012
@spastorino spastorino Revert "Debugger gem doesn't work with patchlevel >= 327"
This reverts commit 0ecd464.
154fee2
@rnesius rnesius Adding sqlserver.yml template to satisfy "-d sqlserver" being given
invocations of "rails new".
716222c
@rafaelfranca rafaelfranca Merge pull request #8247 from rnesius/sqlserver-template
Adding sqlserver.yml template to satisfy "-d sqlserver"
02e3684
@zenspider zenspider Removed extra call to #diff in #assert_recognizes. assert_equal calls…
… it for you and shows the diff. Also delayed message calculation so the cost of the diff on success is now gone.
270d1cf
@zenspider zenspider Please use assert_equal instead of diff directly c0c8792
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8248 from zenspider/master
Removed extra call to #diff in #assert_recognizes
68b0bac
@steveklabnik steveklabnik Add Ruby 2.0 to .travis.yml.
@joshk said it's okay. :)
4bb0aa8
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8249 from steveklabnik/add_two_oh_to_travis
Add Ruby 2.0 to .travis.yml.
f63545c
@alexeymuranov alexeymuranov Add a deprecation before removing find_table_name
The `ActiveRecord::Fixtures::find_table_name` method was removed from "master" almost a year ago, but it was never deprecated.  Here it comes back, more dead than alive.
506b9f2
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8251 from alexeymuranov/deprecate-removed-fixture…
…-methods

Add a deprecation before removing ActiveRecord::Fixtures::find_table_name

Removed in e0ef093
ee94128
@Tho85 Tho85 AR::Base.becomes should not change the STI type
If you want to change the STI type too, use AR::Base.becomes! instead
70fa756
@carlosantoniodasilva carlosantoniodasilva Remove return guard b6a6873
@carlosantoniodasilva carlosantoniodasilva Simplify helper method in attribute methods test 6d2aade
@carlosantoniodasilva carlosantoniodasilva Extract #in_time_zone helper method duplication to a module d4bf1c9
@carlosantoniodasilva carlosantoniodasilva Fix typo in module name and make #in_time_zone private 6c5bd10
@carlosantoniodasilva carlosantoniodasilva Initialize #min_cost to avoid warning in Ruby 2.0 0b63da9
@mikel mikel Upgrade mail dependency to 2.5.0 89a00f3
Commits on Nov 18, 2012
@carlosantoniodasilva carlosantoniodasilva Bump mysql gem version to the newly 2.9.0, fix build. af43e71
@carlosantoniodasilva carlosantoniodasilva Remove not used require and some useless test comments 4525b97
@mikel mikel Upgrade mail dependency to 2.5.2 aff1872
@kommen kommen Add test to ensure preloading works as expected with "select" and "in…
…cludes".

This didn't work in rails 3.1. See #2303 for more information and original pull request.
22ed92d
@senny senny make ActionMailer::QueuedMessage autoloadable 1f1ccbc
@rafaelfranca rafaelfranca Merge pull request #8259 from senny/make_queued_message_autoloadable
make ActionMailer::QueuedMessage autoloadable
06dd7e4
@saulius saulius Point user to strong_parameters as the new protection model [ci skip] 61edea0
@rafaelfranca rafaelfranca Merge pull request #8260 from sauliusg/improved_deprecation_notice
Point user to strong_parameters as the new protection model [ci skip]
5a3e258
@senny senny cleanup, remove whitspace from railties CHANGELOG 7cb0c88
@senny senny require bundler groups to include rake-tasks in engines
If you generate a full engine, this will include rake tasks from
your gem under the `app` namespace. For example if you have a dependency
on `rspec-rails` in your engine's `gemspec`. You will get the task `app:spec`

Closes #8229
a1fd9cd
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8258 from kommen/eager_loading_with_select_test2
Add test to ensure preloading works as expected with "group", "select" and "includes".
5e7919c
@carlosantoniodasilva carlosantoniodasilva Ensure ordering to make the test pass with postgresql a739340
@carlosantoniodasilva carlosantoniodasilva Revert "Merge pull request #4575 from carlosantoniodasilva/remove-tes…
…t-pending"

This reverts commit 1620df7, reversing
changes made to 2d00032.

Conflicts:
	activesupport/CHANGELOG.md
	activesupport/lib/active_support/test_case.rb
4913984
@carlosantoniodasilva carlosantoniodasilva Properly deprecate #pending from AS::TestCase 92da512
@carlosantoniodasilva carlosantoniodasilva Merge branch 'deprecate-pending'
Properly deprecate #pending from AS::TestCase. This has been previously
removed from master, and is now back with a deprecation instead, to avoid
people having tests breaking when upgrading an app.

Please check #4575 for more background.
e21579f
Commits on Nov 19, 2012
@CvX CvX Add rename_index to change_table. 1a782b2
@rafaelfranca rafaelfranca Merge pull request #8266 from CvX/index_rename
Add rename_index to change_table.
f460835
@rafaelfranca rafaelfranca Merge pull request #3023 from Tho85/preserve_sti_type
AR::Base.becomes should not change the STI type

Conflicts:
	activerecord/CHANGELOG.md
0cc9c12
Abhishek Nalwaya displaying error message(p tag was missing) and adding output as comment c33e893
@carlosantoniodasilva carlosantoniodasilva Fix rails db command with sqlite3 database
When using sqlite3 it was attempting to find the database file based on
Rails.root, the problem is that Rails.root is not always present because
we try to first manually load "config/database.yml" instead of loading
the entire app, to make "rails db" faster.

This means that when we're in the root path of the app, calling "rails db"
won't allow us to use Rails.root, making the command fail for sqlite3
with the error:

    ./rails/commands/dbconsole.rb:62:in `start':
      undefined method `root' for Rails:Module (NoMethodError)

The fix is to simply not pass any dir string to File.expand_path, which
will make it use the current directory of the process as base, or the
root path of the app, which is what we want.

When we are in any other subdirectory, calling "rails db" should work
just fine, because "config/database.yml" won't be found, thus "rails db"
will fallback to loading the app, making Rails.root available.

Closes #8257.
53aefde
@carlosantoniodasilva carlosantoniodasilva Refactor config abort message a bit for dbconsole
Remove not used variable.
Remove config attr_reader causing warning.
Fix indent in runner file.
12d32dd
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8256 from nalwayaabhishek/master
Displaying error message if validation fail in examples (p tag was missing)
ea0056f
@rafaelfranca rafaelfranca Merge pull request #8262 from senny/8229_correct_bundler_require_in_e…
…ngines

require bundler groups to include rake-tasks in engines
133cdf0
@carlosantoniodasilva carlosantoniodasilva Initialize accessors to remove some warnings in Ruby 2.0 7e10f38
@carlosantoniodasilva carlosantoniodasilva Remove not needed begin..end from AR#save 3b99653
@spastorino spastorino Fix UpgradeSignatureToEncryptionCookieStore doc 90ee4c5
@spastorino spastorino Add UpgradeSignatureToEncryptionCookieStore to upgrading_ruby_on_rail…
…s guide
ffaab2c
@nateberkopec nateberkopec Explicit multipart messages respect :parts_order
As issue #7978, the order in which ActionMailer
sends multipart messages could be unintentionally
overwritten if a block is passed to the mail
method. This changes the mail method such that
:parts_order is always respected, regardless of
whether a block is passed to mail.
9cf33b5
@rafaelfranca rafaelfranca Merge pull request #8044 from nateberkopec/block_does_not_set_parts_o…
…rder

Explicit multipart messages respect :parts_order
60790e8
@senny senny render every partial with a new `PartialRenderer`.
This resolves issues when rendering nested partials.
Previously the `PartialRenderer` was reused which led to
situations where the state of the renderer was reset.

Closes #8197
1d07d3d
@josevalim josevalim Merge pull request #8212 from senny/8197_make_render_in_spacer_templa…
…te_work

render every partial with a new `PartialRenderer`.
a1c7eae
@carlosantoniodasilva carlosantoniodasilva Be a bit less conservative with mysql in adapter 14620ea
@carlosantoniodasilva carlosantoniodasilva Refactor request tests, remove #with_set method bba8fc4
@tumayun tumayun Fix issue with params in url_for
With a "params" argument, the following error is raised:

    undefined method `reject!` for "":String
e492c44
@carlosantoniodasilva carlosantoniodasilva Correct the use of params options when given to url_for
Merge url for tests and add changelog entry for #8233.
ce60672
@carlosantoniodasilva carlosantoniodasilva Merge branch 'url-for-params'
Fix error when using a non-hash query argument named "params" in `url_for`.

Before:

    url_for(params: "") # => undefined method `reject!' for "":String

After:

    url_for(params: "") # => http://www.example.com?params=`

Closes #8233
03ef833
Commits on Nov 20, 2012
@gaurish gaurish Better Error handling when parsing database.yaml
Provides a better error message incase the database.yaml
has some errors.
61425f2
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8279 from gaurish/database_error
Improved Error handling when parsing database.yaml, Fixes #8143
abb38fe
@asanghi asanghi fix guide with field_with_error proc example e8502ed
@pwnall pwnall Postgresql doesn't accepts limits on text columns. a8a60e9
@rafaelfranca rafaelfranca Merge pull request #8276 from pwnall/pgsql_text_limits
Postgresql doesn't accepts limits on text columns
3a89068
@arunagw arunagw Initialize accessors to remove some warnings in Ruby 2.0 4a7a858
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8282 from arunagw/warning_removed_for_ruby2
Initialize accessors to remove some warnings in Ruby 2.0
f63d654
@rafaelfranca rafaelfranca Merge pull request #8280 from asanghi/fix_guide_field_with_error_proc
fix guide with field_with_error proc example
f042b4e
Commits on Nov 21, 2012
@rafaelfranca rafaelfranca Remove return guard and use code convetions f058e56
@bogdan bogdan Fix postgresql adapter to handle bc timestamps correctly fa73cf7
@semaperepelitsa semaperepelitsa Refactoring, testing and documenting pg_connection.distinct 2197e1f
@rafaelfranca rafaelfranca Merge pull request #8289 from semaperepelitsa/pg_adapter_refactoring_…
…squashed

Refactoring, testing and documenting pg_connection.distinct
6b266c2
@rafaelfranca rafaelfranca Merge pull request #6245 from bogdan/bc_timestamp
Postgresql adapter: fix handling of BC timestamps
1c0e7ab
@tuzz tuzz Typo 104f4fd
@carlosantoniodasilva carlosantoniodasilva Merge pull request #8290 from cpatuzzo/master
Fixed a typo
0cf3092
@steveklabnik steveklabnik Coerce strings in create_join_table.
If you accidentally pass a string and a symbol, this breaks. So
we coerce them both to strings.

Fixes #7715
48a0357
@rafaelfranca rafaelfranca Merge pull request #7716 from steveklabnik/issue_7715
Coerce strings in create_join_table.
b6793ba
@jonleighton jonleighton Merge pull request #8183 from jcoglan/objectless_sessions
Store FlashHashes in the session as plain hashes
293c121
@carlosantoniodasilva carlosantoniodasilva Use secure password min cost option in its own tests for a speed up
Around 0.564359s => 0.092244s speed up in my machine.
c2c1ecb
@carlosantoniodasilva carlosantoniodasilva Move migration test together with other join table tests 96106a1
@jonleighton jonleighton Don't allocate new strings in compiled attribute methods
This improves memory and performance without having to use symbols which
present DoS problems. Thanks @headius and @tenderlove for the
suggestion.

This was originally committed in
f176501, and then reverted in
d349490 due to it causing problems in a
real application. This second attempt should solve that.

Benchmark
---------

require 'active_record'
require 'benchmark/ips'

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')

class Post < ActiveRecord::Base
  connection.create_table :posts, force: true do |t|
    t.string :name
  end
end

post = Post.create name: 'omg'

Benchmark.ips do |r|
  r.report('Post.new')          { Post.new name: 'omg' }
  r.report('post.name')         { post.name }
  r.report('post.name=')        { post.name = 'omg' }
  r.report('Post.find(1).name') { Post.find(1).name }
end

Before
------

Calculating -------------------------------------
            Post.new      1419 i/100ms
           post.name      7538 i/100ms
          post.name=      3024 i/100ms
   Post.find(1).name       243 i/100ms
-------------------------------------------------
            Post.new    20637.6 (±12.7%) i/s -     102168 in   5.039578s
           post.name  1167897.7 (±18.2%) i/s -    5186144 in   4.983077s
          post.name=    64305.6 (±9.6%) i/s -     317520 in   4.998720s
   Post.find(1).name     2678.8 (±10.8%) i/s -      13365 in   5.051265s

After
-----

Calculating -------------------------------------
            Post.new      1431 i/100ms
           post.name      7790 i/100ms
          post.name=      3181 i/100ms
   Post.find(1).name       245 i/100ms
-------------------------------------------------
            Post.new    21308.8 (±12.2%) i/s -     105894 in   5.053879s
           post.name  1534103.8 (±2.1%) i/s -    7634200 in   4.979405s
          post.name=    67441.0 (±7.5%) i/s -     337186 in   5.037871s
   Post.find(1).name     2681.9 (±10.6%) i/s -      13475 in   5.084511s
ae934ae
Commits on Nov 22, 2012
@carlosantoniodasilva carlosantoniodasilva Revert "Yield only one argument instead of splatting."
This reverts commit f9cb645.

Conflicts:
	activerecord/CHANGELOG.md

Revert "Allow blocks for count with ActiveRecord::Relation. Document and test that sum allows blocks"

This reverts commit 9cc2bf6.

Conflicts:
	activerecord/lib/active_record/relation/calculations.rb
76a6bfd
@carlosantoniodasilva carlosantoniodasilva Deprecate Relation#sum with a block.
To perform a sum calculation over the array of elements, use to_a.sum(&block).

Please check the discussion in f9cb645
for more context.
ad9983f
@carlosantoniodasilva carlosantoniodasilva Remove the #sum method from CollectionAssociation
Since edd94ce, CollectionProxy
delegates all calculation methods - except count - to the scope,
which does basically what this method was doing, but since we're
delegating from the proxy, the association method was never called.
fd1c457
@carlosantoniodasilva carlosantoniodasilva Merge branch 'deprecate-calculations-with-block'
Follow up of the discussion from the original merge commit:
f9cb645#commitcomment-1414561

We want to avoid people's mistakes with methods like count and sum when
called with a block, that can easily lead to code performing poorly and
that could be way better written with a db query.

Please check the discussion there for more background.
Closes #8268
a9aeba6
@carlosantoniodasilva carlosantoniodasilva Remove private partial/template renderer methods
Since now these objects are not cached anymore, there's no need to have
these private methods, just instantiate each of them in the necessary
place.
0134ca6
@guilleiguaran guilleiguaran Allow setting a symbol as path in scope on routes
Was surprising found that this example doesn't work:

  scope :api do
    resources :users
  end

and the right form to use it is:

  scope 'api' do
    resources :users
  end

I think this should work similary as `namespace` where both are allowed.
These two are equivalent:

  namespace :api do
    resources :users
  end

  namespace 'api' do
    resources :user
  end
0d3a9e8
@senny senny prevent mass assignment of polymorphic type when using `build`
Closes #8265
053bfa2
@pixeltrix pixeltrix Merge pull request #8114 from guilleiguaran/use-symbols-in-scope
Allow setting a symbol as path in scope on routes
9f68d52
@carlosantoniodasilva carlosantoniodasilva Indent changelog markdown code to highlight correctly
[ci skip]
43dd9c8
@rafaelfranca rafaelfranca Merge pull request #8291 from senny/8265_build_with_polymorphic_assoc…
…iation

prevent mass assignment of polymorphic type when using `build`

Conflicts:
	activerecord/CHANGELOG.md
b313bcb
Commits on Nov 23, 2012
@jonleighton jonleighton Use separate Relation subclasses for each AR class
At present, ActiveRecord::Delegation compiles delegation methods on a
global basis. The compiled methods apply to all subsequent Relation
instances. This creates several problems:

1) After Post.all.recent has been called, User.all.respond_to?(:recent)
   will be true, even if User.all.recent will actually raise an error due
   to no User.recent method existing. (See #8080.)

2) Depending on the AR class, the delegation should do different things.
   For example, if a Post.zip method exists, then Post.all.zip should call
   it. But this will then result in User.zip being called by a subsequent
   User.all.zip, even if User.zip does not exist, when in fact
   User.all.zip should call User.all.to_a.zip. (There are various
   variants of this problem.)

We are creating these compiled delegations in order to avoid method
missing and to avoid repeating logic on each invocation.

One way of handling these issues is to add additional checks in various
places to ensure we're doing the "right thing". However, this makes the
compiled methods signficantly slower. In which case, there's almost no
point in avoiding method_missing at all. (See #8127 for a proposed
solution which takes this approach.)

This is an alternative approach which involves creating a subclass of
ActiveRecord::Relation for each AR class represented. So, with this
patch, Post.all.class != User.all.class. This means that the delegations
are compiled for and only apply to a single AR class. A compiled method
for Post.all will not be invoked from User.all.

This solves the above issues without incurring significant performance
penalties. It's designed to be relatively seamless, however the downside
is a bit of complexity and potentially confusion for a user who thinks
that Post.all and User.all should be instances of the same class.

Benchmark
---------

require 'active_record'
require 'benchmark/ips'

class Post < ActiveRecord::Base
  establish_connection adapter: 'sqlite3', database: ':memory:'
  connection.create_table :posts

  def self.omg
    :omg
  end
end

relation = Post.all

Benchmark.ips do |r|
  r.report('delegation')   { relation.omg }
  r.report('constructing') { Post.all }
end

Before
------

Calculating -------------------------------------
          delegation      4392 i/100ms
        constructing      4780 i/100ms
-------------------------------------------------
          delegation   144235.9 (±27.7%) i/s -     663192 in   5.038075s
        constructing   182015.5 (±21.2%) i/s -     850840 in   5.005364s

After
-----

Calculating -------------------------------------
          delegation      6677 i/100ms
        constructing      6260 i/100ms
-------------------------------------------------
          delegation   166828.2 (±34.2%) i/s -     754501 in   5.001430s
        constructing   116575.5 (±18.6%) i/s -     563400 in   5.036690s

Comments
--------

Bear in mind that the standard deviations in the above are huge, so we
can't compare the numbers too directly. However, we can conclude that
Relation construction has become a little slower (as we'd expect), but
not by a huge huge amount, and we can still construct a large number of
Relations quite quickly.
bceb623