Commit Graph

41866 Commits

Author SHA1 Message Date
Yves Senn
079ffc96c1 let's link to the gem README not to the upgrading guide. [ci skip]
The PR #13767 added link to the upgrading guide to explain
details about activerecord_deprecated-finders. However the link target
features a stack of changes not releated at all. Also the relevant details
are not very informative.

I think we better link to the README so people can see what the gem is about
and how to use it.

/cc @chancancode @zzak
2014-01-20 14:06:37 +01:00
Carlos Antonio da Silva
f63c6e57ee Fix secrets.yml path in exception message
The file is config/secrets.yml, not config/initializers/secrets.yml.
2014-01-20 08:58:43 -02:00
Godfrey Chan
06849fd4d0 Merge pull request #13767 from zzak/doc_4_1_release_notes_deprecated_finders
Add link to upgrade guide for full list of deprecated finders [ci skip]
2014-01-20 02:03:58 -08:00
Godfrey Chan
54befc691c Merge pull request #13769 from arelenglish/fix_typo_upgrad_guide
Fix a typo that says you application [ci skip]
2014-01-19 21:41:29 -08:00
Arel English
7f255245bd Fix a typo that says you application [ci skip] 2014-01-20 00:37:48 -05:00
Godfrey Chan
27f1fd093a Merge pull request #13768 from rajeshthummalapally/rails_blog_correct_patch_link
Fix for incorrect link that is pointing to Rails blog [ci skip]
2014-01-19 21:14:34 -08:00
Rajesh Thummalapally
610a3e8bdb Correcting link that is pointing to Rails blog [ci skip] 2014-01-19 23:47:48 -05:00
Guillermo Iguaran
18e9188709 Merge pull request #13765 from robertomiranda/secrets_token
Update Error Message when secrets.secret_key_base isn't given
2014-01-19 20:08:32 -08:00
robertomiranda
90228a168b Update Error Message when secrets.secret_key_base isn't given 2014-01-19 22:29:34 -05:00
Zachary Scott
9040e04c72 Add link to upgrade guide for full list of deprecated finders [ci skip] 2014-01-19 18:43:51 -08:00
Rafael Mendonça França
b1b21f9325 Merge pull request #13745 from nextgearcapital/master
set encoding for pipe to binary mode
2014-01-19 10:24:22 -08:00
Robin Dupret
935d235f90 Merge pull request #13762 from robertomiranda/spring-under-rails
Update Changelog, Spring is under rails/spring [ci skip]
2014-01-19 06:55:39 -08:00
robertomiranda
7671590fe2 Update Changelog, Spring is under rails/spring [ci skip] 2014-01-19 08:50:15 -05:00
Robin Dupret
0c96f8abb8 Merge pull request #13759 from raysrashmi/rails-spring
Spring in now under rails/spring [ci skip]
2014-01-19 02:02:02 -08:00
Rashmi Yadav
b20d4453dd Spring in now under rails/spring [ci skip] 2014-01-19 10:52:49 +01:00
Andrew White
ab91bc3192 Merge pull request #13756 from huoxito/rails-spring
spring gem moved to rails/spring
2014-01-19 01:36:09 -08:00
Washington Luiz
e05c791264 spring gem moved to rails/spring 2014-01-18 20:22:51 -03:00
Godfrey Chan
3c354bd83b Merge pull request #13751 from chancancode/ar_rollback_fix
Restore ActiveRecord states after a rollback for models w/o callbacks
2014-01-18 14:26:17 -08:00
Godfrey Chan
7386ffc781 Restore ActiveRecord states after a rollback for models w/o callbacks
This fixes a regression (#13744) that was caused by 67d8bb9.

In 67d8bb9, we introduced lazy rollback for records, such that the
record's internal states and attributes are not restored immediately
after a transaction rollback, but deferred until they are first
accessed.

This optimization is only performed when the model does not have any
transactional callbacks (e.g. `after_commit` and `after_create`).

Unfortunately, the models used to test the affected codepaths all
comes with some sort of transactional callbacks. Therefore this
codepath remains largely untested until now and as a result there are
a few issues in the implementation that remains hidden until now.

First, the `sync_with_transaction_state` (or more accurately,
`update_attributes_from_transaction_state`) would perform the
synchronization prematurely before a transaction is finalized (i.e.
comitted or rolled back). As a result, when the actuall rollback
happens, the record will incorrectly assumes that its internal states
match the transaction state, and neglect to perform the restore.

Second, `update_attributes_from_transaction_state` calls `committed!`
in some cases. This in turns checks for the `destroyed?` state which
also requires synchronization with the transaction stae, which causes
an infnite recurrsion.

This fix works by deferring the synchronization until the transaction
has been finalized (addressing the first point), and also unrolled
the `committed!` and `rolledback!` logic in-place (addressing the
second point).

It should be noted that the primary purpose of the `committed!` and
`rolledback!` methods are to trigger the relevant transactional
callbacks. Since this code path is only entered when there are no
transactional callbacks on the model, this shouldn't be necessary. By
unrolling the method calls, the intention here (to restore the states
when necessary) becomes more clear.
2014-01-18 11:16:52 -08:00
Richard Schneeman
35b85d2e7d Merge pull request #13748 from summerblue/master
Correct the version number to 4 in guides[ci skip]
2014-01-17 20:24:47 -08:00
Charlie Jade
bf89bfdc34 Correct the version number to 4 in guides[ci skip] 2014-01-18 12:14:21 +08:00
Aaron Patterson
1543863548 fix exception translation 2014-01-17 14:09:27 -08:00
Aaron Patterson
9bc303cae2 translate exceptions on prepared statement failure 2014-01-17 14:09:14 -08:00
Aaron Patterson
c1bbf1b2e4 test to ensure bad prepared statements raise a StatementInvalid exception 2014-01-17 14:08:00 -08:00
Anna Carey
0e9144dcec set encoding to binmode for pipe 2014-01-17 16:49:10 -05:00
Carlos Antonio da Silva
486db21f91 Fix eager load of Serializers on Active Model 2014-01-17 15:30:09 -02:00
Rafael Mendonça França
a49727213c Consistence in the block style 2014-01-17 00:30:41 -02:00
Rafael Mendonça França
5402b72faa Remove warnings on Ruby 2.1 2014-01-17 00:10:25 -02:00
Rafael Mendonça França
7252b43c6e Only some dynamic finders are deprecated.
find_by_* and find_by_*! are not deprecated for example, so lets add a
note only where it is needed

[ci skip]
2014-01-16 22:12:37 -02:00
Lauro Caetano
b9acc4a838 Merge pull request #13735 from xta/cleanup_security_guide
clean up security guide: his => their [ci skip]
2014-01-16 16:04:22 -08:00
Rex Feng
beeb8969e0 clean up security guide: his => their [ci skip] 2014-01-16 18:57:21 -05:00
Rafael Mendonça França
bcd6def32b Remove warning 2014-01-16 20:36:38 -02:00
Rafael Mendonça França
662f8de06f Merge pull request #13414 from britto/jb-fix-dependency-matching
Improve ERB dependency detection
2014-01-16 13:38:12 -08:00
Carlos Antonio da Silva
49223c9bc9 Extract a method to simplify setup code 2014-01-16 18:52:43 -02:00
Carlos Antonio da Silva
740cf33b5e Use minitest's skip rather than conditionals + early returns 2014-01-16 18:48:51 -02:00
Carlos Antonio da Silva
44e5551054 Move AR test classes inside the test case 2014-01-16 18:45:03 -02:00
Carlos Antonio da Silva
c9c4a427e1 Do not set up a variable used only in two tests
Just create a local variable whenever we need the record, rather than
doing an extra find for every test on the setup method.
2014-01-16 18:40:18 -02:00
Carlos Antonio da Silva
07ff3525d5 No need for instance vars on single tests 2014-01-16 18:40:18 -02:00
Carlos Antonio da Silva
da4b5e8ecb Cleanup duplicated setup of callbacks in transactions tests 2014-01-16 18:40:18 -02:00
Carlos Antonio da Silva
7b11b06e6d No need to use #send with public methods 2014-01-16 18:40:17 -02:00
Carlos Antonio da Silva
c253b8e43b Merge pull request #13734 from tjschuck/fixture_class_name_deprecation_warning
Update fixture class name deprecation warning to give more information about caller
2014-01-16 12:39:26 -08:00
T.J. Schuck
e47203dfde Update deprecation warning to give more information about caller 2014-01-16 14:57:22 -05:00
Aaron Patterson
44c51fc9cc define the delegate methods on one line. fixes #13724
sup haters
2014-01-16 11:55:48 -08:00
Carlos Antonio da Silva
73ba2c14cd Merge branch 'ca-touch-commit-callbacks'
Make AR::Base#touch fire the after_commit and after_rollback callbacks.

Closes #12031.
2014-01-16 09:24:18 -02:00
Harry Brundage
177989c6c0 Make AR::Base#touch fire the after_commit and after_rollback callbacks 2014-01-16 09:05:59 -02:00
Carlos Antonio da Silva
38fcee3871 Fix test for cache_key + touched
Ensure the child can actually be touched. The `Bulb` model has no
timestamp column, thus trying to touch it would return `nil`.
2014-01-16 09:05:55 -02:00
Piotr Sarnacki
fbab7b2acc Revert "methods are defined right after the module_eval, so we don't need to do"
This change breaks tests in activesupport/test/core_ext/module_test.rb:

* test_delegation_exception_backtrace
* test_delegation_exception_backtrace_with_allow_nil

This reverts commit 0167765e3f84260522bc2f32d926c1f5dd44957c.
2014-01-16 10:45:53 +01:00
Piotr Sarnacki
2e0f9ed76e Revert "Don't remove trailing slash from PATH_INFO for mounted apps"
The revert is needed because of a regression described in #13369, routes
with trailing slash are no longer recognized properly.

This reverts commit 50311f1391ddd8e0349d74eb57f04b7e0045a27d.
2014-01-16 10:13:51 +01:00
Piotr Sarnacki
73d8a90bee Add failing test for #13369
After introducing 50311f1 a regression was introduced: routes with
trailing slash are no longer recognized properly. This commit provides a
failing test for this situation.
2014-01-16 10:13:40 +01:00
Yves Senn
2a0ba918c4 Merge branch 'fix_order_dependent_tests_in_active_record_suite'
This gets the whole Active Record suite working without calling
`self.i_suck_and_my_tests_are_order_dependent!` on `ActiveSupport::TestCase`.

Note that the test files themselves still run in order. This means
that only order dependencies within a single test file were addressed.
2014-01-16 10:05:30 +01:00