10305 Commits

Author SHA1 Message Date
Eloy Duran
9290051b85 Added some documentation about setting :autosave => false on an association. 2009-09-12 13:43:17 +02:00
Eloy Duran
c665faac09 During autosave, ignore records that already have been destroyed. [#2537 state:resolved] 2009-09-12 13:43:17 +02:00
Graeme Porteous
a070873771 Fix has_one with foreign_key and primary_key association bug which caused the associated object being lost when saving the owner. [#1756 state:resolved]
Mixed in a bit from patch by ransom-briggs. [#2813 state:resolved]

Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 13:43:16 +02:00
José Valim
11c338735c Rename nested attributes _delete to _destroy to reflect its actual behavior and DSL (:allow_destroy). Deprecation warning added. [#2889 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 13:36:42 +02:00
Dmitry Polushkin
c52a50ec51 Fix autosave association to skip validation if it is marked for destruction. [#2064 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 13:36:42 +02:00
Eloy Duran
2420d6272c Explicitely setting `autosave => false' should override new_record autosaving. [#2214 state:resolved]
Original author is Jacob.
2009-09-12 13:23:05 +02:00
Andrew France
55bc0c76f8 Allow fields_for on a nested_attributes association to accept an explicit collection to be used. [#2648 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 13:16:30 +02:00
Lance Ivy
7c1e4ef64b Don't cascade autosave validation to destroyed children. [#2761 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 13:16:30 +02:00
Mike Breen
52a50db6c0 Raise an exception with friendlier error message when attempting to build a polymorphic belongs_to with accepts_nested_attributes_for. [#2318 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-09-12 13:16:30 +02:00
sdsykes
d48d3d0f41 Fix habtm associations when using multiple databases
[#3128]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-12 02:55:33 -07:00
Jeremy Kemper
3f59a73cb6 activesupport -> active_support 2009-09-12 02:47:25 -07:00
Jeremy Kemper
08d15f86c4 Deprecate "Allow frameworks to be required by their gem name"
This has just been confusing. Better to educate than band-aid.

This deprecates commit 18a24274ec.
Originally from http://dev.rubyonrails.org/ticket/8845 [drnic]
2009-09-12 02:45:33 -07:00
Akira Matsuda
c5e3309bb4 Ruby 1.9 compat: Avoid using the return value of FileUtils.mkdir_p, as it does not return a String but an Array in Ruby 1.9
[#2018 state:committed milestone:2.3.5]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-11 19:21:31 -07:00
Akira Matsuda
44fbc86ab8 Ensure validation errors to be ordered in declared order
[#2301 state:committed milestone:2.3.5]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-11 18:37:32 -07:00
Akira Matsuda
596406f90a Fix default_error_messages back to the original message
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-11 18:31:28 -07:00
Akira Matsuda
3413643e83 1.9 compat: let -c option work with Ruby 1.9
[#3109 state:committed milestone:2.3.5]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-11 18:06:51 -07:00
Akira Matsuda
028d449fe9 1.9 compat: let -g option work with Ruby 1.9
[#3105 state:committed milestone:2.3.5]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-11 18:06:51 -07:00
Jakub Kuźma
5de75398c4 ruby 1.9 friendly secure_compare
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-09-12 12:47:53 +12:00
Shugo Maeda
d2cf33e903 Removed the copyright notice not to show it in the result of 'ri ActiveRecord'. 2009-09-11 15:18:08 -07:00
Nathaniel Talbott
ab9efe9e16 Fix filtering parameters when there are Fixnum or other un-dupable values.
[#3184 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-10 18:52:45 -07:00
Beau Harrington
a32eeebdcb Remove redundant checks for valid character regexp in ActiveSupport::Multibyte#clean and #verify.
[#3181 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-10 17:37:16 -07:00
José Valim
e1b109633c Allow scope to be changed for ActiveRecord::Errors#generate_full_message and change deprecation message [#1687 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:38:45 -05:00
Jeremy Kemper
8a2cfe9de4 Ruby 1.9: fix MessageVerifier#secure_compare 2009-09-08 14:06:35 +09:00
Michael Koziarski
a43ef2436c Prepare for 2.3.4 release v2.3.4 2009-09-04 09:56:09 +12:00
Michael Koziarski
9a68c72b4b Clean tag attributes before passing through the escape_once logic.
Addresses CVE-2009-3009
2009-09-04 09:26:13 +12:00
Manfred Stienstra
07c69380cf Add verify and clean methods to ActiveSupport::Multibyte.
When accepting character input from outside of your application you can't
blindly trust that all strings are properly encoded. With these methods
you can check incoming strings and clean them up if necessary.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-09-04 09:26:13 +12:00
Coda Hale
1f07a89c59 Fix timing attack vulnerability in ActiveSupport::MessageVerifier.
Use a constant-time comparison algorithm to compare the candidate HMAC with the calculated HMAC to prevent leaking information about the calculated HMAC.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-09-04 09:26:13 +12:00
Jeremy Kemper
2b82708b0e Revert "Assert primary key does not exist in habtm when the association is defined, instead of doing that everytime a record is inserted."
Test failures on PostgreSQL.

[#3128]

This reverts commit 594a281d66.
2009-09-02 13:57:33 -07:00
José Valim
594a281d66 Assert primary key does not exist in habtm when the association is defined, instead of doing that everytime a record is inserted.
[#3128 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-01 10:18:47 -07:00
Geoff Buesing
6bf17770af Rails::Info doesn't require version for unwanted frameworks
[#3124 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-01 02:29:46 -07:00
Joshua Peek
6fdfe4cb5f Deprecated "best fit" detection is to difficult. Just provide a switch to toggle the new behavor on.
# new_rails_defaults.rb
  ActionController::Routing.generate_best_match = false
2009-08-31 16:09:47 -05:00
Jay Pignata
49c4a79e59 Duplicating the options hash in Date#advance to prevent modification of the original [#1133 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-31 13:01:34 -05:00
Antonio Tapiador del Dujo
49342d1745 I18n support for plugins
Rails will now automatically add locale files found in any engine's locale
directory to the I18n.load_path (i.e. files that match the glob pattern
"config/locales/**/*.{rb,yml}" relative to engine directories).

[#2325 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-30 13:38:10 -07:00
Jay Pignata
ff8cb50f25 Ensuring that a singular model name is set for use in controllers when scaffold is passed a plural model name
[#3062 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-30 13:31:16 -07:00
Chad Woolley
70ed47f5b4 CI config updates: do not send CI emails unless explicitly enabled, use 'gem update --system', and send emails from an address which can post to the core list
[#3116 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-30 00:06:39 -07:00
Sven Fuchs + Mateo Murphy
13fb26b714 Fix ActiveRecord Error message I18n:
* allow messages and full_messages to be lazily translated at any time
* allow locales to be swapped and still obtain correctly localized messages
* allow localized global and error-type specific full_message formats
* extract an Error class

[#1687 state:open]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-29 09:48:16 -07:00
Jeremy Kemper
05d7409ae5 Prefer utf8_unicode_ci (better) over utf8_general_ci (faster) 2009-08-27 23:09:21 -07:00
Jeffrey Hardy
058459dc22 When running multiple test tasks, don't abort early if one produces failures
[#3107 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-27 11:17:25 -07:00
Jeffrey Hardy
8a49183563 Don't use AR::Base.connection for fixture column quoting. Use the connection given to Fixtures.new
[#3104 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:53:32 -07:00
Jeffrey Hardy
4240890b28 UrlRewriter#rewrite_url should call #to_param on the value given in :anchor option, just as #url_for does
[#2746 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:11:39 -07:00
Akira Matsuda
e46e67c71f I18n: use I18n for select helpers' prompt text
[#2252 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 13:56:15 -07:00
Jeremy Kemper
3cd245b7fa Revert "I18n: use I18n for select helpers' prompt text"
Broke CI.

[#2252 state:open]

This reverts commit d725ad39da.
2009-08-26 12:12:04 -07:00
Sven Fuchs
a4838ee466 allow ActiveRecord#RecordInvalid exception message to be localized
[#2754 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 11:23:30 -07:00
Akira Matsuda
d725ad39da I18n: use I18n for select helpers' prompt text
[#2252 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 09:39:01 -07:00
Jeremy Kemper
e213f0caaa Fix typo 2009-08-25 13:43:20 -07:00
Emilio Tagua
38d6e65c5a timestamps gives a created_at field not created_on.
[#3093 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-25 13:43:14 -07:00
Jeremy Kemper
f1355e6a4d Benchmark script via miloops' arel fork via DataMapper's AR comparison script 2009-08-25 13:43:03 -07:00
Jeremy Kemper
d6a944f778 Add active_support/all for forward compatibility. 2009-08-23 17:18:23 -07:00
Mike Gunderloy
9127c5b7f5 Fix trivial typo in template runner example [#3082 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-20 13:35:21 +01:00
Yehuda Katz
5f6e788e27 Removes examples so it can be replaced with separate repo 2009-08-18 11:15:31 -07:00