Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | 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. | |||||
* | Add validates method as shortcut to setup validators for a given set of ↵ | jamie | 2010-01-07 | 2 | -0/+75 | |
| | | | | | | | | | | | | | | | 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> | |||||
* | Be sure to dup load paths before clearing the array. | José Valim | 2010-01-07 | 1 | -1/+1 | |
| | ||||||
* | Errors messages are now moved from :activerecord.errors to simply :errors on ↵ | José Valim | 2010-01-07 | 2 | -80/+44 | |
| | | | | I18n yml files. | |||||
* | Add missing tests to Validators. | José Valim | 2010-01-03 | 1 | -0/+47 | |
| | ||||||
* | Remove deprecated ActiveModel tests (%d and %s is no longer supported in ↵ | José Valim | 2010-01-02 | 1 | -14/+0 | |
| | | | | error messages a couple months already) | |||||
* | Use activerecord.errors.format as in Rails 2.3.5. | José Valim | 2010-01-02 | 1 | -0/+6 | |
| | ||||||
* | Be sure to convert namespaced names to we have 'Parrots name' instead of ↵ | José Valim | 2010-01-02 | 1 | -1/+1 | |
| | | | | 'Parrots.name' in error messages. | |||||
* | No need to use ValidationsRepairHelper hack on ActiveModel anymore, ↵ | José Valim | 2009-12-23 | 11 | -199/+116 | |
| | | | | Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there. | |||||
* | Move validations in ActiveModel to validators, however all validatity checks ↵ | José Valim | 2009-12-23 | 1 | -2/+2 | |
| | | | | are still in the class method. | |||||
* | Validator is simply sent to validate method. However, the API needs to ↵ | José Valim | 2009-12-22 | 1 | -6/+6 | |
| | | | | change, so validate accepts a record. | |||||
* | Move validator, human_name and human_attribute_name to ActiveModel, remove ↵ | José Valim | 2009-10-20 | 3 | -5/+12 | |
| | | | | | | deprecated error messages and add i18n_scope and lookup_ancestors. Signed-off-by: Carl Lerche <carllerche@mac.com> | |||||
* | Use ActiveModel::TestCase base class | Jeremy Kemper | 2009-09-24 | 1 | -1/+1 | |
| | ||||||
* | Changed ActiveRecord to use new callbacks and speed up observers by only ↵ | José Valim | 2009-09-08 | 2 | -17/+4 | |
| | | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com> | |||||
* | Fix warnings in AMo | Joshua Peek | 2009-09-05 | 1 | -45/+1 | |
| | ||||||
* | Fix failing AMo isolated tests | Joshua Peek | 2009-09-05 | 2 | -0/+3 | |
| | ||||||
* | added proc and symbol support to validates_numericality_of [#3049 ↵ | Kane | 2009-08-31 | 1 | -0/+18 | |
| | | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com> | |||||
* | Add validates_format_of :without => /regexp/ option [Elliot Winkler, Peer Allan] | Elliot Winkler | 2009-08-10 | 1 | -0/+29 | |
| | | | | | | | | | | [#430 state:resolved] Example : validates_format_of :subdomain, :without => /www|admin|mail/ Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | |||||
* | Introduce validates_with to encapsulate attribute validations in a class. | Jeff Dean | 2009-08-09 | 1 | -0/+116 | |
| | | | | | | [#2630 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | |||||
* | Fix exclusive range patch to use begin/end instead of min/max. [#2981 ↵ | Adam Keys | 2009-08-08 | 1 | -0/+14 | |
| | | | | | | | status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | |||||
* | Simplyfy validates_length_of and remove puts | Pratik Naik | 2009-08-08 | 1 | -1/+0 | |
| | ||||||
* | validates_length_of with maximum should allow nil [#2309 status:resolved] | jzw | 2009-08-08 | 1 | -3/+7 | |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | |||||
* | Allow validations to use values from custom readers [#2936 state:resolved] | James Hill | 2009-08-05 | 1 | -0/+14 | |
| | | | | Signed-off-by: Joshua Peek <josh@joshpeek.com> | |||||
* | Simplify AMo validation attribute reader | Joshua Peek | 2009-06-17 | 1 | -9/+9 | |
| | ||||||
* | Merge branch 'master' into active_model | Joshua Peek | 2009-05-29 | 1 | -20/+8 | |
| | | | | | | | | | | | Conflicts: activemodel/lib/active_model/core.rb activemodel/test/cases/state_machine/event_test.rb activemodel/test/cases/state_machine/state_transition_test.rb activerecord/lib/active_record/validations.rb activerecord/test/cases/validations/i18n_validation_test.rb activeresource/lib/active_resource.rb activeresource/test/abstract_unit.rb | |||||
* | Deprecate Errors#on_base/add_to_base/invalid?/each_full | Pratik Naik | 2009-03-21 | 1 | -3/+3 | |
| | ||||||
* | Add ActiveModel::Validations tests for regular ruby classes | Pratik Naik | 2009-03-20 | 8 | -27/+150 | |
| | ||||||
* | Add I18n translations to ActiveModel and move more AR specific parts to ↵ | Pratik Naik | 2009-03-20 | 3 | -404/+320 | |
| | | | | ActiveRecord::Validations | |||||
* | Deprecate Error#on(attribute) in favour of Errors#[attribute] | Pratik Naik | 2009-03-20 | 6 | -65/+65 | |
| | ||||||
* | TestDatabase -> TestsDatabase | Pratik Naik | 2009-03-20 | 10 | -19/+19 | |
| | ||||||
* | Move relevant validation tests from Active Record to Active Model | Pratik Naik | 2009-03-20 | 11 | -0/+1931 | |