Commit Graph

42851 Commits

Author SHA1 Message Date
Sam Ruby 3a9bcd9798 Use latest 2.1 version of sprockets-rails 2014-09-08 15:38:21 -03:00
Rafael Mendonça França 57d65e3b28 Preparing for 4.1.6.rc2 release 2014-09-08 15:10:13 -03:00
Rafael Mendonça França 5cfd7d5428 Do not mark object as persisted after an association is saved
Callback order in Active Record objects are important. Users should not
define callbacks before the association definition or surprising
behaviours like the described at #3798 will happen. This callback order
dependency is documented at 31bfcdc77c/activerecord/lib/active_record/associations.rb (L1222-1227).

This reverts #15728.

Fixes #16620.

Conflicts:
	activerecord/test/cases/associations/has_many_associations_test.rb
2014-09-05 18:49:25 -03:00
Rafael Mendonça França 63fb4330fc Merge pull request #16756 from huoxito/dont-mess-railties-default-order
Dont mess with default order engines load (4.1.6.rc1 regression)
2014-09-03 16:30:21 -03:00
Godfrey Chan 80aa4288dd CHANGELOG & improvements to #16649
* Require either FIRST or LAST qualifier for "NULLS ..."
* Require whitespace before "NULLS ..."

Conflicts:
	activerecord/CHANGELOG.md
2014-08-24 00:01:48 -07:00
Godfrey Chan 3a487289e5 Merge pull request #16649 from Agis-/pg-columns-for-distinct
Fix postgresql adapter #columns_for_distinct trimming whitespace it shouldn't
2014-08-23 23:58:59 -07:00
Xavier Noria b1c1b5d8df Fixes the digits counter of AS's NumberToRoundedConverter
Zero has one digit, but Math.log10(0) returns -Infinity. The method
needs to special-case zero.

The patch adds a regression test that is not clearly related to the
underlying issue because digit_count is private and has no coverage.
Gray area.

This bug was uncovered by 60062cf.
2014-08-20 13:46:32 -03:00
Rafael Mendonça França c5310bed86 Merge pull request #16349 from jmcnevin/master
Correctly determine if migration is needed.
2014-08-19 17:44:54 -03:00
Rafael Mendonça França c3f578c4b8 Preparing for 4.1.6.rc1 release 2014-08-19 14:45:44 -03:00
Abdelkader Boudih 06b185c655 Make ActionMailer::Previews methods class methods.
Conflicts:
	actionmailer/CHANGELOG.md
2014-08-18 23:58:15 -07:00
Rafael Mendonça França e1f358d309 Merge pull request #16542 from seamusabshere/numerify-pool-checkout-timeout-from-urls-4-1-stable
Make sure :checkout_timeout and :dead_connection_timeout are numbers
2014-08-18 21:12:42 -03:00
Rafael Mendonça França fdbfb4bd1c Merge pull request #16546 from aditya-kapoor/remove-broken-link
fix broken link to rails blog [ci skip]
2014-08-18 17:05:34 -03:00
Rafael Mendonça França 9c297ce936 Merge branch '4-1-5' into 4-1-stable
Conflicts:
	actionmailer/CHANGELOG.md
	actionview/CHANGELOG.md
	activerecord/CHANGELOG.md
	activesupport/CHANGELOG.md
	railties/CHANGELOG.md
2014-08-18 14:05:48 -03:00
Rafael Mendonça França 9bb76261d3 Preparing for 4.1.5 release 2014-08-18 13:50:06 -03:00
Rafael Mendonça França 9456990b14 Check attributes passed to create_with and where
If the request parameters are passed to create_with and where they can
be used to do mass assignment when used in combination with
Relation#create.

Fixes CVE-2014-3514
2014-08-18 13:47:25 -03:00
Seamus Abshere cff9608f11 Just like :pool, make sure :checkout_timeout and :dead_connection_timeout are numbers
Using #to_f instead of #to_i because they are specified in seconds instead of milliseconds
2014-08-18 08:11:27 -05:00
Godfrey Chan 28c1a81f9a Merge pull request #16458 from chancancode/ar_fix_reserved_inheritance
Fixed issue w/custom accessors + reserved name + inheritance

Conflicts:
	activerecord/CHANGELOG.md
2014-08-17 12:03:53 -07:00
Rafael Mendonça França 151e5b6b08 Point to rubygems instead of Rails GitHub. [ci skip]
The rails repository is not the official plugin anymore
2014-08-15 10:48:49 -03:00
Arun Agrawal deb0e17517 Fixed link for in_place_editor [ci skip]
closes #16512
2014-08-15 15:47:11 +02:00
Santiago Pastorino 9ab12cbeec Merge pull request #16503 from bogdan/where-hash-nested-relation-4-1-stable
Fixed AR::Relation#where edge case with Hash and other Relation
2014-08-15 10:08:12 -03:00
Yves Senn a075ef3c04 unify CHANGELOG format. 2014-08-15 10:03:17 +02:00
Yves Senn 127749c2bf Merge pull request #16403 from Peeja/baseclass-becomes-subclass-for-4-1
Backport "Fix Baseclass becomes! subclass." for 4.1

Conflicts:
	activerecord/CHANGELOG.md
2014-08-15 10:01:31 +02:00
Bogdan Gusiev 5c1a362525 Fixed AR::Relation#where edge case with Hash and other Relation
Example:

  Author.where(posts: { author_id: Author.where(country_id: 1) }).joins(:posts)

Conflicts:
	activerecord/lib/active_record/relation/query_methods.rb
2014-08-14 18:40:00 +03:00
Yves Senn 1211159be6 Merge pull request #16489 from tomkadwill/updating_options_to_new_style
[ci skip] Updated where scope documentation to conform to new style
2014-08-13 11:51:18 +02:00
Godfrey Chan b31c49c612 Merge pull request #16432 from arthurnn/after_commit_run_on_top_level_trans
Fix regression on after_commit in nested transactions.
2014-08-11 21:05:24 -07:00
Arthur Neves d0993d9e50
Fix regression on after_commit in nested transactions.
after_commit should not run in nested transactions, however they should
run once the outermost transaction gets committed. This patch fixes the
problem copying the records from the Savepoint to its parent. So the
RealTransaction will have all records that needs to run callbacks on it.

[fixes #16425]
2014-08-11 10:15:49 -04:00
Vasily Polovnyov 6af6ff4402 [ci skip] Mention the change in nil handling for serialized attributes
in "Upgrading from Rails 3.2 to Rails 4.0"
2014-08-10 20:33:14 -07:00
Rafael Mendonça França c8d54cdc95 Merge pull request #16411 from calebthompson/backport-param-changes
Fix undefined method to_query for Hash
2014-08-06 23:57:48 -03:00
Caleb Thompson 0dcd98d2eb
Fix undefined method to_query for Hash
When cherry-picking `active_support/core_ext/object/to_param` in 4.1.*,
we still see an undefined method to_query for hash unless we also pull
in `.../to_query`.

This was resolved on master in c420a8da, so this is exclusively a
backport of "Move to_param to to_query, also Improve tests" based on the
Active Support Core Extensions guide's [Cherry-picking a Definition]
section.

[Cherry-picking a Definition]: http://guides.rubyonrails.org/active_support_core_extensions.html#cherry-picking-a-definition
2014-08-06 21:57:18 -05:00
Rafael Mendonça França 6f2ed6d85f Define id_was to get the previous value of the primary key
Currently when we call id_was and we have a custom primary key name
Active Record will return the current value of the primary key. This
make impossible to correctly do an update operation if you change the
id.

Fixes #16413

Conflicts:
	activerecord/CHANGELOG.md
2014-08-06 23:48:17 -03:00
Santiago Pastorino 9733cab515 Merge pull request #16402 from bogdan/select_with_empty_block
Fixed #select form builder helper to support block without html output
2014-08-06 22:53:41 -03:00
Rafael Mendonça França a64763b43f Fix DateTime comparison with DateTime::Infinity object
Fixes #16406

Conflicts:
	activesupport/CHANGELOG.md
2014-08-06 22:45:12 -03:00
Edo Balvers 257d65ed2c Fix Baseclass becomes! subclass. 2014-08-05 11:39:39 -04:00
Santiago Pastorino 999bed074e Regenerate sid when sbdy tries to fixate the session
Fixed broken test.

Thanks Stephen Richards for reporting.
2014-08-04 11:35:58 -03:00
Yves Senn e741d4df09 Raise an exception when attachments are added after `mail` was called.
Closes #16163

Adding attachments after a call to `mail` will result in invalid emails.
This is related to the fact, that `mail` is making the required preparations
before the email is ready to be sent. These change depending on your
added attachments.

Conflicts:
	actionmailer/CHANGELOG.md
2014-08-04 13:54:48 +02:00
Yves Senn 3ea18d68f7 docs, cleanup mixed indents within `form_options_helper.rb` RDoc.
[ci skip]

This fixes the broken code block rendering and indents the examples
within the parameter list.
2014-07-29 15:30:37 +02:00
Yves Senn a553554400 Merge pull request #16328 from noinkling/template_password_confirmation_fix
Give password_confirmation div the "field" class in the scaffold generator "_form" partial

Conflicts:
	railties/CHANGELOG.md
2014-07-29 12:23:25 +02:00
Godfrey Chan 818b5ec8bf Fixed CHANGELOG formating [ci skip] 2014-07-29 01:38:43 -07:00
Godfrey Chan e26c571b38 Merge pull request #16148 from rails/fix_json_autoload
Fix json autoload
Conflicts:
	activesupport/CHANGELOG.md
2014-07-29 01:38:06 -07:00
Yves Senn a7da19acad Merge pull request #16319 from Domon/fix-each-validator-example
Fix example code of EachValidator [ci skip]
2014-07-28 15:20:25 +02:00
David Heinemeier Hansson 42c5d814ac Fix that render layout should also be picked up by the template dependency tracker, but only half-ways. You can add that layout option on the same render call, and both templates should be added to the dependency tree. But thats going to require a more serious rework of the tracker. Please do help fix this part of it too. For now, render layout needs to be on its own line. 2014-07-25 16:35:16 -07:00
Yves Senn e8709aef56 docs, `select` and friends with `multiple=true` include a blank string.
[Jonas Baumann & Yves Senn]

The submitted params from a select with `multiple: true` look as follows:

```
{post: {category: [""]}}

{post: {category: ["", "Category 1", "Category 2"]}}
```

This is a follow up to #1552.
2014-07-17 17:35:30 +02:00
Rafael Mendonça França 5d2b1e9084 nodoc enum hooks [ci skip] 2014-07-16 14:45:13 -03:00
Santiago Pastorino 3e006d5076 Don't accept parameters as argument for redirect to [via @homakov]
Closes #16170
2014-07-16 13:27:05 -03:00
Yves Senn 2bba2e1255 docs, remove unneeded `\` and remove trailing whitespace. [ci skip] 2014-07-16 11:04:33 +02:00
Rafael Mendonça França 9e5cab22a5 Merge pull request #16181 from yahonda/ora972_faces_41
Address ORA-00972: identifier is too long when tested with Oracle
2014-07-15 16:26:44 -03:00
Yasuo Honda c5ab3508c7 Address ORA-00972: identifier is too long when tested with Oracle
by using shorter attribute names.
2014-07-16 02:44:50 +09:00
Jolyon Pawlyn 08e528d1bb Return an absolute instead of relative path from an asset url in the case of the `asset_host` proc returning nil
(cherry picked from commit d005777469)

Conflicts:
	actionview/lib/action_view/helpers/asset_url_helper.rb
2014-07-15 09:35:27 +01:00
Godfrey Chan eca2625472 Fixed SQL syntax for postgresql 2014-07-14 11:11:59 -07:00
Godfrey Chan 5de6ef8fff Merge pull request #16162 from chancancode/fix_json_coder
Fixed JSON coder when loading NULL from DB
2014-07-14 10:38:14 -07:00