| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
's/[ \t]*$//' -i {} \;)
|
|
|
|
|
|
| |
messages are set [#5283 state:open]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
all Ruby core classes.
This is required because the JSON gem is incompatible with Rails behavior and was not allowing ActiveModel::Errors to be serialized.
So we need to ensure Rails implementation is the one triggered. [#4890 state:resolved]
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hash and make various Validators pass their (filtered) options.
This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format".
Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation.
Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options).
Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now.
The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet.
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
ActiveRecord to ActiveModel
[#4653 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
[#4622 state:commited]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
restriction. [#4622 state:resolved]
|
|
|
|
|
|
|
|
| |
object and a message of error
[#4611 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
|
| |
options hash and make various Validators pass their (filtered) options."
Having a huge array to whitelist options is not the proper way to handle this case. This means that the ActiveModel::Errors object should know about the options given in *all* validators and break the extensibility added by the validators itself. If the intent is to whitelist options before sending them to I18n, each validator should clean its respective options instead of throwing the responsibility to the Errors object.
This reverts commit bc1c8d58ec45593acba614d1d0fecb49adef08ff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hash and make various Validators pass their (filtered) options.
This makes it possible to pass additional options through Validators to message
generation. E.g. plugin authors want to add validates_presence_of :foo, :format
=> "some format".
Also, cleanup the :default vs :message options confusion in ActiveModel
validation message generation.
Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in
favor of ActiveModel::Errors#add_on_blank(attributes, options).
Original patch by Sven Fuchs, some minor changes and has been changed to be applicable to master again
[#4057 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
| |
fixtures and test helper)
|
|
|
|
| |
dependency
|
|
|
|
| |
individual validation tests and moved them to their own test file
|
|
|
|
|
|
| |
for I18n
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: wycats <wycats@gmail.com>
|
| |
|
|
|
|
|
|
| |
'Person.validators_on(:name)'.
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
validates :email, :presence => true, :format => /@/
validates :genre, :inclusion => %w(m f)
validates :password, :length => 6..20
|
|
|
|
| |
validator is called, it just needs to check for :maximum, :minimum and :is values.
|
|
|
|
| |
validates.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
attributes:
class Person < ActiveRecord::Base
include MyValidators
validates :name, :presence => true, :uniqueness => true, :length => { :maximum => 100 }
validates :email, :presence => true, :email => true
end
[#3058 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
| |
I18n yml files.
|
| |
|
|
|
|
| |
error messages a couple months already)
|
| |
|
|
|
|
| |
'Parrots.name' in error messages.
|
|
|
|
| |
Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there.
|
|
|
|
| |
are still in the class method.
|
|
|
|
| |
change, so validate accepts a record.
|
|
|
|
|
|
| |
deprecated error messages and add i18n_scope and lookup_ancestors.
Signed-off-by: Carl Lerche <carllerche@mac.com>
|
| |
|
|
|
|
|
|
| |
notifying events that are actually being consumed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|
| |
|
| |
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|
|
|
|
|
|
|
|
|
|
| |
[#430 state:resolved]
Example :
validates_format_of :subdomain, :without => /www|admin|mail/
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|
|
|
|
|
| |
[#2630 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
|
| |
status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
| |
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|