Commit Graph

215 Commits

Author SHA1 Message Date
Charlie Somerville
3770f13b97 replace uses of OrderedHash with just a regular hash 2013-10-15 15:20:43 -04:00
Brian Cardarella
1aae5e70ef Remove deprecation warning for ActiveRecord::Errors#generate_message. This is the same API that ActiveModel ended up using and that won't be changing. 2011-06-09 14:59:33 -07:00
kane
09a23d2290 quote scoped columns in validates_uniqueness_of [#4909 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 17:34:40 +02:00
Prem Sichanugrist
5ed6a8447b Change all i18n interpolations from {{...}} to %{...}
This will silent all warning if there's a i18n version 0.4.x gem install on user's machine.

[#4913 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 01:14:36 +02:00
Lawrence Pit
0706bdce60 docs + test for each_error
[#3185 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-15 11:49:04 -07:00
José Valim
1c3711b21b Fix another regression due to the inclusion of ActiveRecord::Error.
If a string is supplied to :default, it should not be used a
translation key (we already have :message for that).
[#3564 status:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-12-16 14:18:46 -06:00
José Valim
a4540128a4 [PATCH] Optimize Error I18n to avoid unecessary lookups and just retrieve values when needed [#3477 status:resolved].
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-11-10 12:26:33 -06:00
José Valim
f5f7c40f3a Fix nested attributes error messages which is broken in 2.3.4. It still copies the message from child to parent, but does the lookup in the child, not in the parent, avoiding error messages duplication (as happened in 2.3.3). [#3147 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-28 13:44:24 -05: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
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
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
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
Elise Huard
f6f04f1549 validate uniqueness with limit in utf8
[#2653 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 12:53:09 -07:00
Pratik Naik
18eb80ccc7 Merge docrails 2009-03-16 11:28:36 +00:00
Chris Kampmeier
3c64c9a575 Fix spelling of an internal method [#1734 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-12 15:41:31 +00:00
Jeffrey Hardy
96eaeee446 Add ActiveRecord::Base#invalid? as the opposite of #valid? [#2159 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-08 15:20:23 +00:00
Arthur Klepchukov
ccb0a92fa2 Ensure validates_uniqueness_of considers limit on the field. [#1042 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-07 13:52:17 +00:00
Will Bryant
9991868d85 support end-exclusive ... Ranges in SQL hash condition sanitization properly
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1865 state:committed]
2009-02-06 13:43:02 +13:00
miloops
2b8be761e4 validate_length_of should use custom message if given when using in or within.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1057 state:committed]
2009-02-01 14:58:17 +13:00
Josh Susser
ccda96093a Minor refactoring of validates_associated to replace #inject with #collect + #all?
[#1686 state:committed]
2009-01-22 13:45:19 +13:00
Yaroslav Markin
276ea48de9 Remove dead commented out code [#1467 state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
2008-12-21 15:55:42 +00:00
Pratik Naik
c3f53f412c Merge docrails 2008-12-19 14:27:43 +00:00
Akira Matsuda
c3b87dd4c9 Make word separator in AR validation error messages configurable.
[#1294 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-12-08 15:55:02 -08:00
Pratik Naik
dbbae5e00e Merge with docrails 2008-12-07 03:27:53 +01:00
Pratik Naik
a2932784bb Merge docrails 2008-10-05 22:16:26 +01:00
Tarmo Tänav
ea609b265f Ignore all exceptions for validates_acceptance_of columns fetch so it can run even without a database connection
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-09-26 20:09:39 +02:00
Manfred Stienstra
1585a7ed02 Change all calls to String#chars to String#mb_chars. 2008-09-21 18:01:15 +02:00
Pratik Naik
a17027d13a Merge docrails 2008-09-13 20:28:01 +01:00
Michael Koziarski
095ad690f3 Remove the .to_s fix in validates_uniqueness_of, as Chars get quoted correctly. 2008-09-11 22:51:57 +02:00
wmoxam
923f4ecad2 Fixes validates_uniquness_of problem with case insensitive string containing newline characters
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-09-11 17:40:14 +02:00
Pratik Naik
6ef35461dc Merge docrails 2008-09-03 17:58:47 +01:00
Clemens Kofler
1646e8c364 More symbols for send and respond_to?.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-09-03 00:55:22 +02:00
Iain Hecker
76797b4439 translates when a message symbol has been set on builtin validations
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-08-31 13:24:08 -07:00
Eugene Pimenov
743f0e7114 Make case insensitive validates_uniqueness_of use unicode aware downcase method.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-08-29 20:24:20 +02:00
Sven Fuchs
aad429a46e Merge branch 'master' into i18n 2008-08-21 19:04:39 +02:00
Iain Hecker
cf6840773b Custom error messages scope improved 2008-08-21 18:40:44 +02:00
Iain Hecker
fc0358ae16 Added :value as interpolation variable available to error messages 2008-08-20 17:57:53 +02:00
Iain Hecker
12d7872071 Introduced AR::Base.human_name to validations 2008-08-20 17:53:04 +02:00
Tarmo Tänav
e3523f1d33 Fixed validates_uniqueness_of with decimal columns
Only use special case-sensitive comparison operators for text columns in
validates_uniqueness_of as mysql can fail at decimal comparisons with
the BINARY operator.
2008-08-15 15:44:11 -07:00
Iain Hecker
ffeab4e0c1 Cleaned up ActiveRecord i18n scoping 2008-08-14 10:48:33 +02:00
Sven Fuchs
e3ecc3375f provide more useful feedback on missing translations for validation error messages 2008-08-13 13:52:07 +02:00
Sven Fuchs
bdf783b5a8 update i18n usage for pluralization hashes (api change) 2008-08-10 21:29:02 +02:00
Tarmo Tänav
656f0e7c6c Fix file permissions
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-07-31 16:36:23 -05:00
Tarmo Tänav
f7eaab96d3 validates_uniqueness_of uses database case sensitivity support instead of using ruby
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-07-31 21:33:11 +02:00
Tarmo Tänav
68b207b087 Cast value to string in validates_uniqueness_of if the column is of text type
This fixes an error for postgresql where "text_column = 100" fails in version 8.3

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-07-31 20:28:39 +02:00
Tom Ward
f205939348 Ensure checked value is a string when validating case-sensitive uniqueness [#361 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-19 16:14:39 +01:00
Jeremy Kemper
636e6b7138 Merge branch 'master' into i18n-merge
Conflicts:

	actionpack/lib/action_view/helpers/form_options_helper.rb
	activerecord/lib/active_record/validations.rb
2008-07-17 11:52:56 -07:00
Pratik Naik
0432d15164 Merge with docrails. 2008-07-16 13:01:23 +01:00
Sven Fuchs
2e74ddbd73 missed to remove a call to to_s while resolving conflicts in validations.rb 2008-07-16 04:35:00 +02:00
Sven Fuchs
931f366ffc merge forward to current rails/master 2008-07-16 03:41:11 +02:00