1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

22 commits

Author SHA1 Message Date
Carlos Antonio da Silva
0ee6aa749c Set hash value instead of merge a single key, and use flatten! if possible
There's no need to create two extra hashes with options.merge(another_hash),
with the goal of setting only one value, so lets just set it.

Also refactor validates_each to use _merge_attributes, like other
validates_* helpers do.
2012-06-26 22:21:18 -03:00
Francesco Rodriguez
65362af7a8 add :nodoc: to internal implementations [ci skip] 2012-06-25 12:14:50 -05:00
Francesco Rodriguez
a9e66c62e9 fixing validates_with docs 2012-05-16 08:56:31 -05:00
Oscar Del Ben
8c16333286 minor docs improvements 2012-04-26 10:34:51 +02:00
Alexey Vakhov
448df2d100 Cosmetic fixes in AM validatations docs 2011-11-27 10:23:40 +04:00
Evgeniy Dolzhenko
c317419359 Use .add instead of << to add errors 2011-10-11 14:13:08 +01:00
Bogdan Gusiev
8620bf90c5 Implemented strict validation concept
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
2011-08-17 17:26:00 +03:00
Ben Marini
c02288e6fd Fix example code for #validates_with instance method 2011-07-24 12:13:23 -07:00
Paco Guzman
8e0affbd86 Configuration options are symbols 2011-03-06 22:35:26 +01:00
Carl Lerche
cd13fbd8d8 Optionally pass in the attribute being validated to an instance method validator 2011-02-05 16:44:35 -08:00
Carl Lerche
e9e9ed6b60 Be able to pass a validator method to #validates 2011-02-05 16:33:00 -08:00
José Valim
0421fb7a91 Refactor previous commit a bit [#4057 state:resolved] 2010-06-21 12:17:24 +02:00
Rizwan Reza
3ae67fbebb Add titles to the rest of the files in active_model/validations/* 2010-06-15 22:20:19 +04:30
Josh Kalderimis
92160219a8 minor changes to instance level validations implementation based on feedback from José Valim 2010-05-13 13:57:37 -07:00
Josh Kalderimis
9131a88bb8 validation macros can now be used within an instance 2010-05-13 13:57:37 -07:00
Prem Sichanugrist
8f97e9d19a Add validators reflection so you can do 'Person.validators' and 'Person.validators_on(:name)'.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-21 12:37:46 +01:00
jamie
0a79eb7889 Add validates method as shortcut to setup validators for a given set of 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>
2010-01-07 19:23:59 +01:00
José Valim
279067639f validates_each uses a BlockValidator. 2009-12-23 01:38:15 +01:00
José Valim
f1085f4128 Move validations in ActiveModel to validators, however all validatity checks are still in the class method. 2009-12-23 00:36:51 +01:00
José Valim
2476c5312d Validator is simply sent to validate method. However, the API needs to change, so validate accepts a record. 2009-12-22 23:12:21 +01:00
José Valim
4f37b97033 Changed ActiveRecord to use new callbacks and speed up observers by only notifying events that are actually being consumed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:26:39 -05:00
Jeff Dean
22f3398253 Introduce validates_with to encapsulate attribute validations in a class.
[#2630 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:47:56 -07:00