Commit Graph

77 Commits

Author SHA1 Message Date
amitkumarsuroliya
ccbf1597b7 Replace #=> with # => [ci skip]
@rafaelfranca suggested in f7c7bcd9c2 that code examples should display
the result after  `# =>` and not after `#=>`.
2015-09-19 13:45:13 +05:30
Arthur Nogueira Neves
29886d9304 Merge pull request #20897 from lukechesser/guide-fix-for-acceptance-validation
Update Validation guide for acceptance method
2015-09-14 21:18:19 -04:00
amitkumarsuroliya
08c0ef777f Updated MySQL documentation link to MySQL latest version 5.7 everywhere [ci skip]
Bumps from `5.6` to `5.7`
2015-09-10 07:38:18 +05:30
Rafael Mendonça França
57393957e1 Merge pull request #17351 from akshat-sharma/master
Add case_sensitive option for confirmation validation
2015-09-01 02:42:43 -03:00
Akshat Sharma
2438a1cf4e Add case_sensitive option for confirmation validation
Case :- 1. In case of email confirmation one needs case insensitive comparison
        2. In case of password confirmation one needs case sensitive comparison

[ci skip] Update Guides for case_sensitive option in confirmation validation
2015-09-01 10:42:51 +05:30
Luke Chesser
29acc869db Update validation guide for acceptance method 2015-07-16 00:53:42 -04:00
Yves Senn
4cc5917dce docs, clarify the meanaing of return values from validation methods.
[ci skip]

Closes #20792.

Custom validation methods are implemented in terms of
callbacks. The `validate` callback chain can't be halted using return
values of individual callbacks.
2015-07-07 14:39:58 +02:00
Jurnell Cockhren
d30f0011a9 removed erroneous line. Corrected presence validation example.
Addresses #20343.
Removes erroneous line of code in the sample codeblock.
2015-05-28 15:03:37 -05:00
Ronak Jangir
76fbfe9e6c Updated postgresql documentation link to use latest version [ci skip] 2015-05-20 14:00:31 +05:30
Roque Pinel
8f09a8396f [ci skip] add to doc that acceptance validator allows nil by default 2015-05-19 22:20:10 -04:00
Tim Wade
335137148a
[ci skip] Improve grammar/syntax in AR validations docs. 2015-05-16 09:06:34 -07:00
Angelo Capilleri
5c3be16ed2 [ci skip] Uniquiness with scope can have one or more arguments 2015-05-03 09:11:06 +02:00
Jon Atack
616f9a8fdb [ci skip] Active Record Validations guide fixes
- Remove deprecated `[]=`

- Fix duplicate `errors#add` example. The second code example was
originally `[]=`, replace it with `[] <<`.

- Improve explanations for `errors#add` and `errors#full_messages`

Follow-up to PR #19457 (closed after borking my git history). Apologies
for the duplicate PR.

cc @kaspth
2015-03-25 13:30:41 +05:30
Aditya Kapoor
98d1ea7411 [ci-skip] correct doc about custom validators 2015-02-27 19:25:25 +05:30
Rafael Mendonça França
787bbb8fba Oops 💣 2015-02-20 21:01:08 -02:00
Rafael Mendonça França
f55bfe7260 Change the deprecation messages to show the preferred way to work with
ActiveModel::Errors
2015-02-20 20:58:58 -02:00
yuuji.yaginuma
66e2e19bc0 use messages instead of deprecated ActiveModel::Errors#[]= method [ci skip] 2015-02-20 23:53:36 +09:00
Zachary Scott
baf571dd0d Merge pull request #18815 from tmingos/patch-1
Correct pluralization error
2015-02-16 10:06:09 -08:00
Robin Dupret
1747c4e2ce Tiny documentation edits [ci skip] 2015-02-15 19:19:04 +01:00
Taylor Mingos
3c57c8608f Edit text on optional db constraints for uniqueness validations [ci skip] 2015-02-04 14:15:55 -05:00
yuuji.yaginuma
fce9c4e5e1 fix regexp for validate an integer in guides [ci skip] 2015-01-22 22:56:41 +09:00
Wojciech Wnętrzak
cb74473db6 Add ActiveModel::Errors#details
To be able to return type of validator, one can now call `details`
on Errors instance:

```ruby
class User < ActiveRecord::Base
  validates :name, presence: true
end
```

```ruby
user = User.new; user.valid?; user.errors.details
=> {name: [{error: :blank}]}
```
2015-01-20 22:33:42 +01:00
Vipul A M
5cfaf5a46e - Changed IN to ON in markdown renderer condition
- Changed `IN` to `ON` in all note sentences in guides.
2015-01-14 11:52:13 +05:30
Xavier Noria
7702974281 warn about reading guides in GitHub
References #18148.
2014-12-23 23:32:50 +01:00
Andrey Nering
5d6c6ec099 Adding information about 'allow_nil' option for 'numericality' [ci skip] 2014-12-09 19:10:50 -02:00
Vijay Dev
9887a2cfe5 Merge branch 'master' of github.com:rails/rails 2014-11-04 13:20:22 +00:00
Robin Tweedie
be318260a3 better example for tokenizer lambda [ci skip]
Splitting on whitespace makes more sense in the context of counting words in an
essay.
2014-10-29 13:13:39 +00:00
Juanito Fatas
22166764cd [ci skip] Add missing blank line to AR validation. 2014-10-25 21:33:15 +08:00
Igor Kapkov
b9a67bf3d2 fix wrong #17318 [ci skip] 2014-10-19 20:56:51 +08:00
Igor Kapkov
a77089c1c5 make guides example more friendly to nonlatin langs 2014-10-19 20:25:57 +08:00
Rob
c5c08c6499 mention the :without option [ci skip]
As pointed out in the ActiveModel::Validations::HelperMethods #validates_format_of documentation.
2014-10-16 12:24:32 +01:00
Zachary Scott
a4d8b62ed1 Clarify possible validations you can use to avoid a NULL boolean value
in the database. Closes #16304 [ci skip]
2014-10-03 17:37:49 -07:00
Max Goldstein
b76269a692 [Guides] Sentence break for clarity [ci-skip] 2014-07-11 09:07:34 -04:00
tbpgr
d2623476f3 Fix guide. sample code syntax error.[ci skip] 2014-07-04 00:05:11 +09:00
John Kelly Ferguson
d02c810e29 Rename Posts to Articles in Guides, continuation of 2d446e77 / #13774 [ci skip] 2014-05-21 23:01:45 -04:00
Josef Šimánek
981dda53db Use generated binstubs in guides examples.
[ci skip]
2014-05-20 13:29:18 +02:00
Vijay Dev
92fdd65162 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/active_record_validations.md
	guides/source/api_documentation_guidelines.md
	guides/source/configuring.md
2014-02-09 23:33:55 +05:30
Zachary Scott
605c81b9de Use full-length version of multiple from c7abc51 2014-02-09 12:29:00 +01:00
Yves Senn
4e4a92e78a docs, link MySQL manual for multi column indexes. [ci ckip].
Closes #9131.
2014-02-09 12:28:50 +01:00
Yves Senn
c7abc516f8 docs, link MySQL manual for multi column indexes. [ci ckip].
Closes #9131.
2014-02-04 13:38:48 +01:00
John Olmsted & Strand McCutchen
098a960266 Reordered classes in AR Validation #validates_with example [ci skip]
Person called GoodnessValidator before it was defined.
This change will compile the example correctly.
2014-01-24 11:30:07 -08:00
Paul Nikitochkin
28be1a28ea Removed redundant field name in the guide
Fixes: #13108
[ci skip]
2013-12-01 08:01:28 +02:00
Alex Johnson
b9a4560d91 [ci skip] Replace #=> with # => 2013-11-12 19:23:50 +05:30
Sıtkı Bağdat
a94186f836 Remove size alias for length validation
Removed ```The `size` helper is an alias for `length`.``` line. If you use this "nonexist" helper, you will get an error message like this: 

```
ArgumentError: Unknown validator: 'SizeValidator'
...
```

Maybe wanted to mean ```validates_size_of``` helper as an alias for ```validates_length_of``` helper.
2013-10-14 22:14:30 +03:00
Sıtkı Bağdat
464def3ecf Fix a writing mistake
A small mistake found in the line of ```The default error is "can't be empty"``` for ```:presence``` helper. ```empty``` word changed to ```blank```.
2013-10-12 16:47:17 +03:00
Francis Go
a46138c98e [Validations Guide] Add full stop to the end of sentence [ci skip] 2013-10-10 00:12:57 +11:00
Xavier Noria
b77f25cb84 cleans the guides sources from fancy non-ASCII stuff 2013-08-23 17:59:11 +02:00
Takehiro Adachi
740f7787e0 Fix active_record_validations.md document, :save for on: validation helper was never available
According to the guide, ":save" value for the "on:" validation helper
was available like below

    validates :name, presence: true, on: :save

but this was never available according to the implementation of the
valid? method, which is below

    # Runs all the validations within the specified context. Returns
+true+ if
    # no errors are found, +false+ otherwise.
    #
    # If the argument is +false+ (default is +nil+), the context is set
to <tt>:create</tt> if
    # <tt>new_record?</tt> is +true+, and to <tt>:update</tt> if it is
not.
    #
    # Validations with no <tt>:on</tt> option will run no matter the
context. Validations with
    # some <tt>:on</tt> option will only run in the specified context.
    def valid?(context = nil)
      context ||= (new_record? ? :create : :update)
      output = super(context)
      errors.empty? && output
    end

So the documentation was always wrong since the PR proposed by
@neerajdotname  ( #10287 ) was rejected.
2013-08-04 18:37:12 +09:00
Yves Senn
20281b7f39 fix typo in Active Record Validations guide. [ci skip].
Closes #11498.
2013-07-19 07:44:53 +02:00
Rashmi Yadav
11cae34701 [doc] Update return false if record is invalid 2013-06-19 19:01:33 +02:00