Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Removing unwanted method and adding to accessor for getter history | prasath | 2012-01-25 | 1 | -4/+3 |
| | |||||
* | added :other_than => :!= option to numericality validator | Jakub Kuźma | 2011-12-21 | 1 | -0/+7 |
| | |||||
* | Remove dead code from AMo. | José Valim | 2011-12-20 | 1 | -47/+37 |
| | |||||
* | Fixed test "ArgumentError: wrong number of arguments(1 for 0)" | Arun Agrawal | 2011-12-17 | 1 | -1/+1 |
| | |||||
* | Fixed bug when error message is an empty string. | Antonio Roberto | 2011-12-16 | 1 | -0/+6 |
| | |||||
* | Update variable's name in the test case to reflect the class we're testing | Prem Sichanugrist | 2011-11-18 | 3 | -24/+24 |
| | |||||
* | Follow code conventions on some tests | Sebastian Martinez | 2011-05-10 | 4 | -29/+29 |
| | |||||
* | No need to rescue here. Invoking the wrong method in an object can happen ↵ | José Valim | 2011-04-11 | 3 | -34/+0 |
| | | | | anywhere if you are not careful. In other words, test your shit. | ||||
* | Revert "Add :use_include option to allow user to explicitly use ↵ | José Valim | 2011-04-11 | 2 | -19/+0 |
| | | | | | | | | `Range#include?` method in Ruby 1.9" Use :with => range.to_a instead. This reverts commit f6540211b5b9133c9f93c11655a04d613c237e67. | ||||
* | Add :use_include option to allow user to explicitly use `Range#include?` ↵ | Prem Sichanugrist | 2011-04-10 | 2 | -0/+19 |
| | | | | | | method in Ruby 1.9 In Ruby 1.9 we're currently use `Range#cover?` to fix the performance problem. However, there might be the case that you want to use `Range#include?` instead. This patch will give you that option. | ||||
* | Add support for proc or lambda as an option for InclusionValidator, ↵ | Prem Sichanugrist | 2011-04-10 | 3 | -0/+82 |
| | | | | | | ExclusionValidator, and FormatValidator You can now use a proc or lambda in :in option for InclusionValidator and ExclusionValidator, and :with, :without option for FormatValidator | ||||
* | Refactor length validation | Santiago Pastorino | 2011-03-12 | 1 | -3/+3 |
| | |||||
* | length validation for fixnums | Andriy Tyurnikov | 2011-03-12 | 1 | -0/+11 |
| | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | Active Model typos. | R.T. Lechow | 2011-03-05 | 1 | -1/+1 |
| | |||||
* | Revert "Properly interpolate i18n keys in modules [#5572 state:resolved]" | Santiago Pastorino | 2011-02-27 | 1 | -19/+0 |
| | | | | | | | This breaks #6448, you should use :"module/class" as key for namespacing [#6448 state:committed] This reverts commit 8d30193b08bd2321a7a78a1f481bd5e4d4d45557. | ||||
* | Change validates inclusion to use cover? for Ranges in ruby 1.9 [#6453 ↵ | Frederick Cheung | 2011-02-18 | 1 | -0/+9 |
| | | | | | | state:committed] Signed-off-by: Xavier Noria <fxn@hashref.com> | ||||
* | Optionally pass in the attribute being validated to an instance method validator | Carl Lerche | 2011-02-05 | 1 | -0/+9 |
| | |||||
* | Be able to pass a validator method to #validates | Carl Lerche | 2011-02-05 | 1 | -0/+12 |
| | |||||
* | Provide a way to specify alternate option keys for validates | Carl Lerche | 2011-02-05 | 1 | -0/+11 |
| | |||||
* | Do not require that validation attributes be specified as symbols | Carl Lerche | 2011-02-05 | 1 | -0/+11 |
| | |||||
* | Add support for namespaced validators | Samuel Kadolph | 2010-12-16 | 1 | -0/+8 |
| | | | | | | Includes test and documentation for new feature Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | Properly interpolate i18n keys in modules [#5572 state:resolved] | Rodrigo Rosenfeld Rosas | 2010-09-24 | 1 | -0/+19 |
| | |||||
* | Better shortcut options for custom validators [#5672 state:resolved] | Obie Fernandez | 2010-09-24 | 1 | -0/+9 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵ | Santiago Pastorino | 2010-08-14 | 1 | -4/+4 |
| | | | | 's/[ \t]*$//' -i {} \;) | ||||
* | Failing test for validates_length_of, when both too_short and too_long ↵ | rohit | 2010-08-03 | 1 | -0/+14 |
| | | | | | | messages are set [#5283 state:open] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Missing BigDecimal dependency | Jeremy Kemper | 2010-06-27 | 1 | -0/+2 |
| | |||||
* | Work around the fact the JSON gem was overwriting to_json implementation for ↵ | José Valim | 2010-06-26 | 1 | -1/+1 |
| | | | | | | | 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] | ||||
* | Avoid method redefined warning | Santiago Pastorino | 2010-06-22 | 1 | -1/+2 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options ↵ | Jeroen van Dijk | 2010-06-21 | 2 | -379/+210 |
| | | | | | | | | | | | | | | | | 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> | ||||
* | ActiveModel::Validations::Callbacks should not be required by default. | José Valim | 2010-06-19 | 1 | -0/+1 |
| | |||||
* | moving before_validation and after_validation functionality from ↵ | Neeraj Singh | 2010-06-19 | 1 | -0/+76 |
| | | | | | | | | ActiveRecord to ActiveModel [#4653 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Add a valid hex that shouldn't be valid to ActiveModel numericality tests ↵ | rohit | 2010-05-18 | 1 | -1/+1 |
| | | | | | | [#4622 state:commited] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Valid hex strings aren't valid float column values, to match the integer ↵ | Jeremy Kemper | 2010-05-17 | 1 | -1/+1 |
| | | | | restriction. [#4622 state:resolved] | ||||
* | Make use of assert_equal to test equallity between object assert expects and ↵ | Santiago Pastorino | 2010-05-16 | 1 | -2/+2 |
| | | | | | | | | object and a message of error [#4611 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Revert "Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an ↵ | José Valim | 2010-05-15 | 2 | -73/+73 |
| | | | | | | | | 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. | ||||
* | Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options ↵ | Jeroen van Dijk | 2010-05-15 | 2 | -73/+73 |
| | | | | | | | | | | | | | | | | | | | | 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> | ||||
* | removed AR from all AMo tests, including any unneeded files (schema, ↵ | Josh Kalderimis | 2010-05-09 | 13 | -27/+2 |
| | | | | fixtures and test helper) | ||||
* | removed an old unused model in the AMo tests which also removes another AR ↵ | Josh Kalderimis | 2010-05-09 | 7 | -7/+0 |
| | | | | dependency | ||||
* | removed use of AR in AMo tests and removed testing of scopes (:on) in ↵ | Josh Kalderimis | 2010-05-08 | 11 | -247/+188 |
| | | | | individual validation tests and moved them to their own test file | ||||
* | Favor %{} in all code instead of (deprecated) {{}} as interpolation syntax ↵ | Lawrence Pit | 2010-05-03 | 8 | -37/+37 |
| | | | | | | for I18n Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Fix validates_numericaly_of only integer error message [#4406 state:resolved] | reu | 2010-04-25 | 1 | -9/+9 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | errors.rb needs to be declared as UTF-8 [#3941 state:resolved] | Aaron Patterson | 2010-04-02 | 1 | -0/+10 |
| | | | | Signed-off-by: wycats <wycats@gmail.com> | ||||
* | Accept array of attributes as arg also, like 2.3 | Jeremy Kemper | 2010-02-25 | 1 | -10/+16 |
| | |||||
* | Add validators reflection so you can do 'Person.validators' and ↵ | Prem Sichanugrist | 2010-02-21 | 1 | -0/+1 |
| | | | | | | 'Person.validators_on(:name)'. Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Drop AR I18n deprecation and simple use errors.messages as fallback. | José Valim | 2010-01-30 | 1 | -14/+14 |
| | |||||
* | Fix typos and add tests to ensure they will be caught the next time. | José Valim | 2010-01-11 | 1 | -0/+8 |
| | |||||
* | Fix typo by renaming :genre to :gender. | José Valim | 2010-01-09 | 1 | -6/+6 |
| | |||||
* | Allow validates to map some types to specific options. So now you can do: | José Valim | 2010-01-08 | 1 | -11/+37 |
| | | | | | | validates :email, :presence => true, :format => /@/ validates :genre, :inclusion => %w(m f) validates :password, :length => 6..20 | ||||
* | Compile length validator options still at the class level, so whenever the ↵ | José Valim | 2010-01-08 | 1 | -4/+2 |
| | | | | validator is called, it just needs to check for :maximum, :minimum and :is values. | ||||
* | Allow :if, :unless, :on, :allow_nil and :allow_blank as shared options in ↵ | José Valim | 2010-01-07 | 1 | -3/+38 |
| | | | | validates. |