| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Only one constraint option can be used at a time (except for the minimum
and maximum ones that can eventually be combined). However, other
options can be used with them (e.g. the validation failure message).
So let's make the distinction between these two different options
categories.
[Yves Senn, Matthew Draper & Robin Dupret]
|
| |
|
|
|
|
|
| |
The heading "Active Model Length Validator" was shown on the
"ActiveModel::Validations" page without any text following it.
|
| |
|
|
|
|
|
|
|
|
| |
As demonstrated by #19570, this option is severely limited, and
satisfies an extremely specific use case. Realistically, there's not
much reason for this option to exist. Its functionality can be trivially
replicated with a normal Ruby method. Let's deprecate this option, in
favor of the simpler solution.
|
| |
|
| |
|
|
|
|
| |
links in rdoc [ci skip]
|
|
|
|
|
| |
I also attempted to fix other styleguide violations such as
{ a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
|
|
|
|
| |
When nil or empty string are not allowed, they are not valid.
|
| |
|
|
|
|
|
|
| |
errors_options is calculated for every *CHECKS* but it could be
calculated one time because options and RESERVED_OPTIONS
not change during this cycle
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Allow infinite values for validates_length_of. Particularly useful
for prettily defining an open ended range such as
validates_length_of :human_stupidity, :within => 0..Float::INFINITY
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
In order to deliver debug information to dev team
instead of display error message to end user
Implemented strict validation concept
that suppose to define validation that always raise exception when fails
|
| |
|
| |
|
| |
|
|
|
|
| |
it only when needed.
|
| |
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
|
| |
|
|
|
|
| |
's/[ \t]*$//' -i {} \;)
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
state:resolved]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
for I18n
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|\
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_controller/metal/flash.rb
|
| |
| |
| |
| | |
validator is called, it just needs to check for :maximum, :minimum and :is values.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|