Skip to content
This repository
  • 10,000 commits
  • 220 files changed
  • 24 comments
  • 50 contributors
This comparison is big! We're only showing the most recent 250 commits
Nov 09, 2012
Carlos Antonio da Silva Remove not used load hooks for active_record_config
These were removed with ActiveRecord::Model in
9e4c41c#L15L156
9622b3f
Steve Klabnik Deprecate Hash#diff.
It's no longer used in Rails any more.

See #8142 for more
88d59de
Carlos Antonio da Silva Merge pull request #8158 from steveklabnik/deprecate_diff
Deprecate Hash#diff.
e56b890
César Carruitero change rdoc syntax for adecuate render [ci-skip] 0500bec
César Carruitero correct link syntax [ci-skip] 477cf31
Andrew White 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
César Carruitero update syntax and add note about prompt use of HttpHelpers [ci-skip] d89b03a
Carlos Antonio da Silva 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
Trivial documentation fix for ActiveModel::Naming comment. ba291a6
Rafael Mendonça França Merge pull request #8162 from fimmtiu/master
Trivial documentation fix for ActiveModel::Naming comment [ci skip]
90a1721
Will Gray Update guides/source/rails_application_templates.md
Update function signatures for `#gem` and `#generate`.
407e7d4
Will Gray Update guides/source/rails_application_templates.md
Add `#environment`
dcf401e
Nov 10, 2012
Nikita Afanasenko Keep the code related to serialization in Serialization module.
We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module.
410e887
Carlos Antonio da Silva Merge pull request #8164 from nikitug/keep_serialization_in_its_module
Keep the code related to serialization in Serialization module.
a002442
Arun Agrawal Removing warning : assigned but unused variable c33c991
Bogdan Gusiev Do not create useless database transaction when building `has_one` as…
…sociation.
3cb0f3f
Carlos Antonio da Silva Merge pull request #8154 from bogdan/has_one_association_performance
Remove unwanted transaction when has one association is built
e803f3a
Avner Cohen 1.9 Syntax related changes 890da51
Carlos Antonio da Silva Merge pull request #8165 from arunagw/warning_removed_unused_variables
Removing warning : assigned but unused variable
62039ad
Vijay Dev update turbolinks readme link [ci skip] 3a76ee4
Vijay Dev recent railties changes added to the release notes [ci skip] 8ec5166
Nicolas Despres 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
Avner Cohen 1.9 hash syntax in activesupport 8553b7a
burningTyger make comments fit the comment boxes (mostly) in API doc guides 46100f0
Jon Leighton 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 use em-dashes instead of two minuses in guides 8dabfbe
Nov 11, 2012
Arun Agrawal Removing warning : ambiguous first argument 5ff5cce
Nikita Afanasenko Test Hash#diff deprecation, also prevent deprecation message in AS tests 63ee59d
Santiago Pastorino Merge pull request #8170 from arunagw/warning_removed_railties
Removing warning : ambiguous first argument
c49fff9
Santiago Pastorino Merge pull request #8172 from nikitug/silent_diff_deprecation
Test Hash#diff deprecation, also prevent deprecation message in AS tests
eda34c4
Nikita Afanasenko 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
Carlos Antonio da Silva Merge pull request #8173 from nikitug/match_classes_without_to_s
Match classes without to_s conversions.
f9dc917
Carlos Antonio da Silva Remove duplicated ConnectionHandling extension in AR::Base 2f3d81c
Nov 12, 2012
James Mead 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
Vipul A M Merge and add tests related to 5215 5359ad9
Yves Senn `#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
Yves Senn cleanup, removed whitespace from CHANGELOG d5ac280
Santiago Pastorino Debugger gem doesn't work with patchlevel < 327 0ecd464
Yves Senn `#pluck` can be used on a relation with `select` clause.
Closes #7551
663d9ef
Guillermo Iguaran Update production.rb documentation: only files in app/assets are in c…
…onfig.assets.precompile
40f5f31
Guillermo Iguaran Update production.rb: Split long comment in two lines 8132bb6
Carlos Antonio da Silva Merge pull request #8184 from vipulnsward/add_merge_tests
Merge and add tests related to #5215
2a8b673
Xavier Noria depend on voloko/sdoc again
voloko/sdoc seems to be maintained again, in particular
the issues that made us fork it are resolved.
5287d36
Matthew Robertson Updated the preformance_testing guide to reflect the fact that prof-r…
…ails no longer needs to be fetched from github
7864f83
Aaron Patterson only clear caches if we are actually connected to the database 85cc712
Carlos Antonio da Silva Merge pull request #8185 from senny/8182_as_json_options_stick_around
`#as_json` isolates options when encoding a hash. Closes #8182
d5c4370
Aaron Patterson Ruby 2.0.0 defaults source encoding to utf-8 so we need to specifical…
…ly tag this file with us-ascii
8f3f50a
Nov 13, 2012
Nikita Afanasenko Add a regression test on #8195 ff2973a
Carlos Antonio da Silva 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
Carlos Antonio da Silva Use new mocha version and add changelog entry for #8180 c940aa6
Rafael Mendonça França Merge pull request #8201 from nikitug/regression_test_on_ar_cache_key…
…_precision

Add a regression test on #8195
12990c4
Rafael Mendonça França Merge pull request #8176 from senny/7551_pluck_with_select
`#pluck` can be used on a relation with `select` clause (#7551)
3a33572
Nikita Afanasenko Regression test for #7238 8424d0d
Carlos Antonio da Silva Merge pull request #8202 from nikitug/regression_test_on_dynamic_find…
…er_result

Regression test for #7238
087150d
Carlos Antonio da Silva Assert the query result instead of checking for nothing raised 9ad8d67
Nicolas Despres Add ChangeLog entry. f945178
Aaron Patterson backporting Struct#to_h from ruby 2.0 8f6ce1a
Rafael Mendonça França Merge pull request #8169 from nicolasdespres/robust_git_repository_check
Rake test:uncommitted finds git directory in ancestors.
3c5c93b
Daniel Lopes add details on password confirmation used with has_secure_password d7536e6
Aaron Patterson replace present? with any? to reduce dependency on AS 9a64ffc
Aaron Patterson only do hash lookups on options once bf35465
Aaron Patterson start using options object 95ec448
Aaron Patterson use the options object in the wrapper defaults fc29bff
Aaron Patterson wrap up hash conversion in the constructor df3b650
Aaron Patterson attribute_names will always return a list, so just use any? 4729208
Aaron Patterson move the controller class to the options object d7c7270
Aaron Patterson model name is lazily evaluated in the options object 46284a1
Aaron Patterson move include calculation to include method on the options object 2a51d6c
Aaron Patterson lazily calculate name in the options object e5248aa
Aaron Patterson asset compilation should not require a database connection e5946e0
Nov 14, 2012
Richard Schneeman add AR deep dive video links to guides 25648ce
Carlos Antonio da Silva 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
Trevor Turk Use BCrypt's MIN_COST in the test environment for speedier tests 06faa6d
Rafael Mendonça França Merge pull request #8216 from trevorturk/master
Use BCrypt's MIN_COST in the test environment for speedier tests
77edb7c
Marc-André Lafortune Avoid using Integer#/, as it is redefined by the 'mathn' stdlib dc3ac35
Rafael Mendonça França Merge pull request #8222 from marcandre/avoid_slash
Avoid using Integer#/, as it is redefined by the 'mathn' stdlib
f732f9b
Nov 15, 2012
Xavier Noria dependencies no longer trigger Kernel#autoload in remove_const [fixes #… bff4d8d
Xavier Noria 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 Anastasopoulos Use the more compact syntax in the example a84dd20
Agis Anastasopoulos Minor punctuation improvement in ActionController guide c15b65d
Agis Anastasopoulos Replace "name" with "author" in the Cookies example
I think doing `@comments.name` is a little confusing, just doesn't sounds right.
688d8bf
Agis Anastasopoulos Slightly improve the syntax b3a3870
Agis Anastasopoulos 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 Anastasopoulos Add a note for the example in Setting Custom Headers 168f5b1
Agis Anastasopoulos Slightly improve the syntax & grammar f76b64c
Agis Anastasopoulos Remove unecessary word 2d7ea2c
Agis Anastasopoulos Some minor fixes 763c82e
Nikita Afanasenko 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 Anastasopoulos 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 Anastasopoulos Some minor fixes & improvements c675922
Agis Anastasopoulos Move "Using Action View outside of Rails" at the bottom
See 8db41ff7698eed542fb09821de37fc7ea1f2bd5d why
bf63c49
Agis Anastasopoulos Improve the starting sentence c1a6614
Agis Anastasopoulos Update table of contents as a result of #bf63c4971d73e80739c9f2619a9f…
…a0dfb2223435
42707db
Rafael Mendonça França Merge pull request #8219 from nikitug/threadsafe_xmlmini_with_backend
Make XmlMini.with_backend usable with threads

Conflicts:
	activesupport/CHANGELOG.md
cf3eb6d
Agis Anastasopoulos Minor improvements & fixes 472b25c
Agis Anastasopoulos Minor improvements & fixes 3fb67b4
Maxime RETY Fix AS::Concern example (current example doesn't work) d0ba816
Maxime RETY Fix another AS::Concern example (class_eval is already called by incl…
…uded)
2ff8881
Agis Anastasopoulos Update links to API documentation & add a TODO 90d780c
Agis Anastasopoulos Minor improvements & fixes c675482
Agis Anastasopoulos Some minor improvements f60a51f
Agis Anastasopoulos Add links to TryGit & official documentation bf9ddc4
Santiago Pastorino Merge pull request #8112 from rails/encrypted_cookies
Encrypted cookies
ef8b845
Agis Anastasopoulos Switch to 1.9 hash syntax f3b95a6
Agis Anastasopoulos Switch to 1.9 hash syntax plus minor fixes 3f8bd32
Agis Anastasopoulos Fix 'persons' to 'people' and add some whitespace 204d3af
Agis Anastasopoulos Switch to 1.9 hash syntax ba280c6
Agis Anastasopoulos Switch to 1.9 hash syntax 000121e
Agis Anastasopoulos Properly align some example comments 25ac03c
Agis Anastasopoulos Switch to 1.9 hash syntax d8596c4
Aaron Patterson create fewer relation objects d5a8bdb
Aaron Patterson stop passing *args to generate aliases f77beac
Aaron Patterson stop hardcoding FrontBase adapter conditionals ca71bb8
Aaron Patterson arel columns can be used for grouping so that "weird" column names ar…
…e usable
0803d7a
Agis Anastasopoulos Switch to 1.9 hash syntax plus minor fixes 4ce1690
Agis Anastasopoulos Switch to 1.9 hash syntax and remove unnecessary punct. 699075a
Agis Anastasopoulos Switch to 1.9 hash syntax 5e32350
Agis Anastasopoulos Switch to 1.9 hash syntax fe44565
Agis Anastasopoulos Switch to 1.9 hash syntax 75f6e45
Santiago Pastorino Add nodoc to DummyKeyGenerator since it's a private thing d348c43
Santiago Pastorino Add docs for CachingKeyGenerator e6e3317
Santiago Pastorino Remove extra whitespace 44f12bb
Nov 16, 2012
Agis Anastasopoulos 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
Agis Anastasopoulos Remove the ActiveRecordHelper section
Since ActionView::Helpers::ActiveRecordHelper is removed.
21ef4e1
Agis Anastasopoulos Add a consideration note and a WIP note fe66191
Kentaro Kuribayashi Updated dependency for bundler to ~> 1.2.2 65c2d2f
Joost Baaij 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
Marc-André Lafortune Use Integer#div instead of Integer#/ to avoid side effects from mathn 22edb66
José Valim Merge pull request #8235 from tilsammans/dont_escape_actionmailer_whe…
…n_plaintext

Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`
4a4de56
Marc-André Lafortune Simplify (and optimize) 3c4a0b2
Xavier Noria Merge pull request #8236 from marcandre/use_div
Use div
832b1e5
Agis Anastasopoulos Switch to 1.9 hash syntax & remove some parentheses when it reads nicer 85482e1
Agis Anastasopoulos Add a consideration note
regarding linking to Kindle
17fd344
Agis Anastasopoulos Switch to 1.9 hash syntax fe30769
Agis Anastasopoulos Switch to 1.9 hash syntax 6f54aac
Agis Anastasopoulos Switch to 1.9 hash syntax (guides) da7febd
Agis Anastasopoulos Switch to 1.9 hash syntax (guides) 8b178b3
Agis Anastasopoulos Remove unnecessary whitespace e7ba7c3
Agis Anastasopoulos Add link to the Application Templates guide 991b883
Agis Anastasopoulos Remove unnecessary whitespace 3ad89fc
Carlos Antonio da Silva Fix failing template tests
Introduced in 4a4de56.
8e49fa6
Carlos Antonio da Silva 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
Carlos Antonio da Silva Remove config.threadsafe! from production env template
Closes #8232 [ci skip]
2bad4d2
Carlos Antonio da Silva Move changelog entry from #8235 to the top [ci skip] de20deb
Agis Anastasopoulos Update the middleware stack to reflect the current Rails output
Specifically, remove `ActionDispatch::Head` in favor of `Rack::Head`.
8be3a1a
Kentaro Kuribayashi Depend bundler from `=> 1.2.2` to `< 2.0` 9a07996
Rafael Mendonça França Merge pull request #8234 from kentaro/bundler-1.2.2
Updated dependency on bundler to ~> 1.2.2
8d06b62
Agis Anastasopoulos Switch to 1.9 hash syntax (guides) e258225
Agis Anastasopoulos Switch to 1.9 hash syntax (guides) d0767ce
Santiago Pastorino Remove unused config option 1acdc4d
Santiago Pastorino Remove duplicated get /foo/write_session 571b747
Santiago Pastorino Add missing env param to get_cookie 0e2bd1d
Santiago Pastorino Call get_cookie to allow the method to be overriden by subclasses d4b9a3f
Santiago Pastorino 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
Santiago Pastorino Improve UpgradeSignatureToEncryptionCookieStore docs
I suck at English, please help me reviewing this <3 <3 <3
[ci skip]
d56cfad
Carlos Antonio da Silva Merge pull request #8244 from yahonda/mysql_ruby200
Now mysql gem can be built on ruby 2.0.0-preview1
1e9522c
George Brocklehurst Test for has_many bug on unsaved records
See issue #7950.
3e64859
Carlos Antonio da Silva Fix some AR changelog entries [ci skip] 7411970
Santiago Pastorino Revert "Debugger gem doesn't work with patchlevel >= 327"
This reverts commit 0ecd464.
154fee2
Robert Nesius Adding sqlserver.yml template to satisfy "-d sqlserver" being given
invocations of "rails new".
716222c
Rafael Mendonça França Merge pull request #8247 from rnesius/sqlserver-template
Adding sqlserver.yml template to satisfy "-d sqlserver"
02e3684
Nov 17, 2012
Vijay Dev Revert "add AR deep dive video links to guides"
This reverts commit 25648ce.
2b5b36e
Vijay Dev Revert "Switch to 1.9 hash syntax"
This reverts commit d8596c4.

Reason: too many mistakes [ci skip]
47411cc
Vijay Dev remove kindle link from guides index [ci skip] 578eba0
Vijay Dev copy edits and fixes [ci skip] 1fd008c
Vijay Dev Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_dispatch/routing/redirection.rb
7b70eee
Vijay Dev Remove old comments about using our own sdoc fork [ci skip] 5d239ac
Yasuo Honda 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
Ryan Davis 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
Ryan Davis Please use assert_equal instead of diff directly c0c8792
Carlos Antonio da Silva Merge pull request #8248 from zenspider/master
Removed extra call to #diff in #assert_recognizes
68b0bac
Steve Klabnik Add Ruby 2.0 to .travis.yml.
@joshk said it's okay. :)
4bb0aa8
Carlos Antonio da Silva Merge pull request #8249 from steveklabnik/add_two_oh_to_travis
Add Ruby 2.0 to .travis.yml.
f63545c
Alexey Muranov 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
Carlos Antonio da Silva Merge pull request #8251 from alexeymuranov/deprecate-removed-fixture…
…-methods

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

Removed in e0ef093
ee94128
Thomas Hollstegge AR::Base.becomes should not change the STI type
If you want to change the STI type too, use AR::Base.becomes! instead
70fa756
Carlos Antonio da Silva Remove return guard b6a6873
Carlos Antonio da Silva Simplify helper method in attribute methods test 6d2aade
Carlos Antonio da Silva Extract #in_time_zone helper method duplication to a module d4bf1c9
Carlos Antonio da Silva Fix typo in module name and make #in_time_zone private 6c5bd10
Carlos Antonio da Silva Initialize #min_cost to avoid warning in Ruby 2.0 0b63da9
Carlos Antonio da Silva Bump mysql gem version to the newly 2.9.0, fix build. af43e71
Carlos Antonio da Silva Remove not used require and some useless test comments 4525b97
Nov 18, 2012
Mikel Lindsaar Upgrade mail dependency to 2.5.0 89a00f3
Mikel Lindsaar Upgrade mail dependency to 2.5.2 aff1872
Dieter Komendera 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
Yves Senn make ActionMailer::QueuedMessage autoloadable 1f1ccbc
Rafael Mendonça França Merge pull request #8259 from senny/make_queued_message_autoloadable
make ActionMailer::QueuedMessage autoloadable
06dd7e4
Saulius Grigaliunas Point user to strong_parameters as the new protection model [ci skip] 61edea0
Rafael Mendonça França Merge pull request #8260 from sauliusg/improved_deprecation_notice
Point user to strong_parameters as the new protection model [ci skip]
5a3e258
Yves Senn cleanup, remove whitspace from railties CHANGELOG 7cb0c88
Yves Senn 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
Carlos Antonio da Silva 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
Carlos Antonio da Silva Ensure ordering to make the test pass with postgresql a739340
Carlos Antonio da Silva 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
Carlos Antonio da Silva Properly deprecate #pending from AS::TestCase 92da512
Carlos Antonio da Silva 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
Rafael Mendonça França Merge pull request #8266 from CvX/index_rename
Add rename_index to change_table.
f460835
Rafael Mendonça França Merge pull request #3023 from Tho85/preserve_sti_type
AR::Base.becomes should not change the STI type

Conflicts:
	activerecord/CHANGELOG.md
0cc9c12
Carlos Antonio da Silva 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
Carlos Antonio da Silva Refactor config abort message a bit for dbconsole
Remove not used variable.
Remove config attr_reader causing warning.
Fix indent in runner file.
12d32dd
Nov 19, 2012
Jarek Radosz Add rename_index to change_table. 1a782b2
displaying error message(p tag was missing) and adding output as comment c33e893
Carlos Antonio da Silva Merge pull request #8256 from nalwayaabhishek/master
Displaying error message if validation fail in examples (p tag was missing)
ea0056f
Rafael Mendonça França Merge pull request #8262 from senny/8229_correct_bundler_require_in_e…
…ngines

require bundler groups to include rake-tasks in engines
133cdf0
Carlos Antonio da Silva Initialize accessors to remove some warnings in Ruby 2.0 7e10f38
Carlos Antonio da Silva Remove not needed begin..end from AR#save 3b99653
Santiago Pastorino Fix UpgradeSignatureToEncryptionCookieStore doc 90ee4c5
Santiago Pastorino Add UpgradeSignatureToEncryptionCookieStore to upgrading_ruby_on_rail…
…s guide
ffaab2c
Nate Berkopec 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
Rafael Mendonça França Merge pull request #8044 from nateberkopec/block_does_not_set_parts_o…
…rder

Explicit multipart messages respect :parts_order
60790e8
Yves Senn 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
José Valim Merge pull request #8212 from senny/8197_make_render_in_spacer_templa…
…te_work

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

    undefined method `reject!` for "":String
e492c44
Carlos Antonio da Silva Correct the use of params options when given to url_for
Merge url for tests and add changelog entry for #8233.
ce60672
Carlos Antonio da Silva 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
Nov 20, 2012
Gaurish Sharma Better Error handling when parsing database.yaml
Provides a better error message incase the database.yaml
has some errors.
61425f2
Carlos Antonio da Silva Merge pull request #8279 from gaurish/database_error
Improved Error handling when parsing database.yaml, Fixes #8143
abb38fe
Aditya Sanghi fix guide with field_with_error proc example e8502ed
Victor Costan Postgresql doesn't accepts limits on text columns. a8a60e9
Rafael Mendonça França Merge pull request #8276 from pwnall/pgsql_text_limits
Postgresql doesn't accepts limits on text columns
3a89068
Carlos Antonio da Silva Merge pull request #8282 from arunagw/warning_removed_for_ruby2
Initialize accessors to remove some warnings in Ruby 2.0
f63d654
Rafael Mendonça França Merge pull request #8280 from asanghi/fix_guide_field_with_error_proc
fix guide with field_with_error proc example
f042b4e
Rafael Mendonça França Remove return guard and use code convetions f058e56
Nov 21, 2012
Arun Agrawal Initialize accessors to remove some warnings in Ruby 2.0 4a7a858
Bogdan Gusiev Fix postgresql adapter to handle bc timestamps correctly fa73cf7
Semyon Perepelitsa Refactoring, testing and documenting pg_connection.distinct 2197e1f
Rafael Mendonça França Merge pull request #8289 from semaperepelitsa/pg_adapter_refactoring_…
…squashed

Refactoring, testing and documenting pg_connection.distinct
6b266c2
Rafael Mendonça França Merge pull request #6245 from bogdan/bc_timestamp
Postgresql adapter: fix handling of BC timestamps
1c0e7ab
Chris Patuzzo Typo 104f4fd
Carlos Antonio da Silva Merge pull request #8290 from cpatuzzo/master
Fixed a typo
0cf3092
Steve Klabnik 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
Rafael Mendonça França Merge pull request #7716 from steveklabnik/issue_7715
Coerce strings in create_join_table.
b6793ba
Jon Leighton Merge pull request #8183 from jcoglan/objectless_sessions
Store FlashHashes in the session as plain hashes
293c121
Carlos Antonio da Silva 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
Carlos Antonio da Silva Move migration test together with other join table tests 96106a1
Jon Leighton 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
Carlos Antonio da Silva 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
Carlos Antonio da Silva 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
Carlos Antonio da Silva 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
Carlos Antonio da Silva 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
Carlos Antonio da Silva 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
Guillermo Iguaran 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
Nov 22, 2012
Yves Senn prevent mass assignment of polymorphic type when using `build`
Closes #8265
053bfa2
Andrew White Merge pull request #8114 from guilleiguaran/use-symbols-in-scope
Allow setting a symbol as path in scope on routes
9f68d52
Carlos Antonio da Silva Indent changelog markdown code to highlight correctly
[ci skip]
43dd9c8
Rafael Mendonça França 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
Nov 23, 2012
Jon Leighton 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