aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations.rb
Commit message (Collapse)AuthorAgeFilesLines
* Show RecordInvalid in the documentation. References #10976 [kampers]Michael Koziarski2008-02-101-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove misleading / incorrect warning from validation documentation. Closes ↵Michael Koziarski2008-02-091-11/+0
| | | | | | #8241 [quixoten, pedz, tom] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8825 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make the docs reference the correct function. [Tobi Reif]Michael Koziarski2008-02-041-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add tests and documentation for allow_blank. Closes #10651 [blj]Michael Koziarski2008-01-261-0/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Extract ActiveSupport::Callbacks from Active Record, test case setup and ↵Jeremy Kemper2008-01-191-91/+31
| | | | | | teardown, and ActionController::Dispatcher. Closes #10727. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8664 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: instance_eval binding to get the record binding instead of ↵Jeremy Kemper2008-01-061-1/+1
| | | | | | accidentally getting current Kernel#binding. Closes #10716 [Dirkjan Bussink] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8575 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More thoroughly quote table names. Exposes some issues with sqlite2 adapter. ↵Jeremy Kemper2008-01-051-4/+4
| | | | | | Closes #10698. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document what to pass the :accept option for validates_acceptance_of when ↵Marcel Molina2007-12-131-1/+2
| | | | | | mapping the attribute to an actual column (rather than a virtual one). Closes #10491 [xaviershay] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8379 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that validates_acceptance_of still works for non-existent tables (useful ↵Rick Olson2007-12-121-2/+8
| | | | | | for bootstrapping new databases). Closes #10474 [hasmanyjosh] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8377 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document the validates class method. Closes #10216 [Farley Knight]Jeremy Kemper2007-12-101-1/+27
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8345 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add documentation about the virtual attribute added by ↵Marcel Molina2007-12-051-3/+6
| | | | | | validates_confirmation_of and its behavior. Closes #8815 [JEG2, matt, kampers] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8288 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document the :message option for validates_associated. Closes #10357 [dylans]Marcel Molina2007-12-051-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8281 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix documentation typo introduced in [8250]. Closes #10339 [Henrik N]Marcel Molina2007-12-021-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Warn users about the race condition in validates_uniqueness_of. [Koz]Michael Koziarski2007-12-011-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8250 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow validates_acceptance_of to use a real attribute instead of only ↵David Heinemeier Hansson2007-11-251-3/+3
| | | | | | virtual (so you can record that the acceptance occured) (closes #7457) [ambethia] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8208 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_inclusion_of and validates_exclusion_of allow formatted :message ↵Jeremy Kemper2007-11-201-4/+6
| | | | | | strings. Closes #8132 [devrieda, Mike Naberezny] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8172 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Smattering of grammatical fixes to documentation. Closes #10083 [BobSilva]Marcel Molina2007-11-081-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_uniqueness_of behaves well with abstract superclasses. References ↵Jeremy Kemper2007-10-231-1/+15
| | | | | | #3833, closes #9886. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8000 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_uniqueness_of behaves well with single-table inheritance. Closes ↵Jeremy Kemper2007-10-081-1/+4
| | | | | | #3833. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7787 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* minor speedups + forward-compat syntaxJeremy Kemper2007-09-131-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7471 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :allow_blank to validations. Like allow_nil, but for values which are ↵Michael Koziarski2007-09-051-1/+8
| | | | | | +blank?+. [jnoon] Closes #7383 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7407 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated functionality from edge rails. Closes #9387 [lifofifo]Michael Koziarski2007-09-031-13/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pass the right binding when string is passed to :if with validations. ↵Michael Koziarski2007-08-281-1/+1
| | | | | | [caspercg] Closes #9300 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use extract_options instead of ad-hoc partial implementations. [norbert] ↵Michael Koziarski2007-08-281-11/+12
| | | | | | Closes #9313 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove unnecessary loop in validates_presence_of. [sur] Closes #9392Michael Koziarski2007-08-281-7/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7362 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make sure create! raises errors on validation when creating multiple ↵Michael Koziarski2007-08-281-1/+1
| | | | | | records. [hasmanyjosh] Closes #8952 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7361 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* misc doc fixes + Add ActiveResource to Rails::Info. Closes #8741, #9008, ↵Rick Olson2007-07-251-45/+45
| | | | | | #9089 [kampers] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :unless clause to validations (closes #8003) [monki]David Heinemeier Hansson2007-07-241-3/+36
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed validates_associated should not stop on the first error (closes #4276) ↵David Heinemeier Hansson2007-06-231-1/+1
| | | | | | [mrj/manfred/josh] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_numericality_of takes :greater_than, :greater_than_or_equal_to, ↵Jeremy Kemper2007-05-261-14/+51
| | | | | | :equal_to, :less_than, :less_than_or_equal_to, :odd, and :even options. Closes #3952. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document :allow_nil option for validates_acceptance_of since it defaults to ↵Marcel Molina2007-05-061-0/+1
| | | | | | true. Closes #8050. [tzaharia] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6687 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix typo in validations documentation. Closes #7669. [ee]Marcel Molina2007-03-031-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Docs: validations examples. Closes #7343.Jeremy Kemper2007-01-241-13/+74
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6031 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Apply scoping during initialize instead of create. Fixes setting of foreign ↵Tobias Lütke2007-01-121-1/+0
| | | | | | key when using find_or_initialize_by with scoping. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* [DOCS] Document :allow_nil option of #validate_uniqueness_of. Closes #3143 ↵Rick Olson2007-01-051-0/+1
| | | | | | [Caio Chassot] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Consolidated different create and create! versions to call through to the ↵Tobias Lütke2006-12-061-4/+2
| | | | | | base class with scope. This fixes inconsistencies, especially related to protected attribtues. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5684 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_numericality_of uses \A \Z to ensure the entire string matches ↵Jeremy Kemper2006-11-201-3/+5
| | | | | | rather than ^ $ which may match one valid line of a multiline string. Closes #5716. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5589 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Run validations in the order they were declared. Closes #6657.Jeremy Kemper2006-11-201-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Consistently use LOWER() for uniqueness validations (rather than mixing with ↵Jeremy Kemper2006-11-051-2/+2
| | | | | | UPPER()) so the database can always use a functional index on the lowercased column. Closes #6495. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* a few more deprecation improvementsJamis Buck2006-10-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5360 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated add_on_boundary_breaking (use validates_length_of instead) ↵David Heinemeier Hansson2006-10-091-0/+1
| | | | | | (closes #6292) [BobSilva] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5255 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Rollback [4917]. Closes #785.Jeremy Kemper2006-09-071-2/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Backed out of new_record? to new? transformation as it would screw up ↵David Heinemeier Hansson2006-09-051-3/+8
| | | | | | existing models that did boolean calls on "new" attributes [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated ActiveRecord::Base.new_record? in favor of ↵David Heinemeier Hansson2006-09-051-8/+3
| | | | | | ActiveRecord::Base.new? (old version still works until Rails 2.0) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document validates_presences_of behavior with booleans: you probably want ↵Jeremy Kemper2006-09-041-0/+4
| | | | | | validates_inclusion_of :attr, :in => [true, false]. Closes #2253. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4980 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* validates_confirmation_of only kicks in when the attribute, rather than its ↵Jeremy Kemper2006-09-031-1/+2
| | | | | | confirmation, is present. Closes #785. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4917 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* alias_method_chain preserves method punctuation so foo, foo?, and foo! may ↵Jeremy Kemper2006-06-211-1/+1
| | | | | | be chained with the same feature. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4482 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* create! no longer blows up when no attributes are passed and a :create scope ↵Jeremy Kemper2006-05-191-0/+1
| | | | | | is in effect (e.g. foo.bars.create! failed whereas foo.bars.create!({}) didn't.) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace alias method chaining with Module#alias_method_chain. [Marcel Molina ↵Marcel Molina2006-04-291-8/+3
| | | | | | Jr.] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4312 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace Ruby's deprecated append_features in favor of included. [Marcel ↵Marcel Molina2006-04-291-2/+1
| | | | | | Molina Jr.] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de