Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | check for valid options in validate method | sonnym | 2014-07-17 | 1 | -0/+6 |
| | | | | | | | | | | | This change prevents a certain class of user error which results when mistakenly using the `validate` class method instead of the `validates` class method. Only apply when all arguments are symbols, because some validations use the `validate` method and pass in additional options, namely the `LenghValidator` via the `ActiveMode::Validations::validates_with` method. | ||||
* | ActiveRecord/ActiveModel '#validate' alias for 'valid?' | Henrik Nyh | 2014-03-27 | 1 | -0/+4 |
| | | | | | | | | It's unintuitive to call '#valid?' when you want to run validations but don't care about the return value. The alias in ActiveRecord isn't strictly necessary (the ActiveModel alias is still in effect), but it clarifies. | ||||
* | Fix doc markup of clear_validators! | Carlos Antonio da Silva | 2014-01-27 | 1 | -2/+2 |
| | |||||
* | Ability to specify multiple contexts when defining a validation. | Vince Puzzella | 2014-01-27 | 1 | -5/+9 |
| | | | | | | Example: validates_presence_of :name, on: [:update, :custom_validation_context] | ||||
* | revises references to :allow_(nil|blank) in some docs [ci skip] [Steven Yang ↵ | Xavier Noria | 2014-01-26 | 1 | -2/+0 |
| | | | | | | & Xavier Noria] Closes #11247. | ||||
* | Adding missing backslashes in active_model files so as to avoid unwanted ↵ | aditya-kapoor | 2013-12-27 | 1 | -1/+1 |
| | | | | links in rdoc [ci skip] | ||||
* | remove some evals from callback conditionals | Aaron Patterson | 2013-06-11 | 1 | -1/+3 |
| | |||||
* | fix ActiveModel::Validations.validators_on doc | Daichi Arai | 2013-06-10 | 1 | -1/+0 |
| | |||||
* | Convert ActiveModel to 1.9 hash syntax. | Patrick Robertson | 2013-05-01 | 1 | -1/+1 |
| | | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ). | ||||
* | Tidying up some require : removing useless sort and homogenizing with the ↵ | Intrepidd | 2013-03-20 | 1 | -4/+1 |
| | | | | rest of the code the wat the includes are done | ||||
* | The repair_validations helper was not working correctly before because | wangjohn | 2013-03-19 | 1 | -0/+43 |
| | | | | | | it only cleared the validations that created :validate callbacks. This didn't include the validates created by validates_with, so I've added a method to clear all validations. | ||||
* | cleanup, removed dispensable `require` statements from `ActiveModel` | Yves Senn | 2012-11-25 | 1 | -3/+0 |
| | |||||
* | convert comments to 1.9 hash syntax | AvnerCohen | 2012-10-22 | 1 | -5/+5 |
| | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-10-21 | 1 | -1/+1 |
|\ | | | | | | | | | | | Conflicts: activesupport/lib/active_support/core_ext/hash/slice.rb guides/source/active_support_core_extensions.md | ||||
| * | minor edits in AM documentation [ci skip] | Francesco Rodriguez | 2012-10-21 | 1 | -1/+1 |
| | | |||||
* | | active_model/validations requires necessary files to run | Yves Senn | 2012-10-18 | 1 | -0/+1 |
| | | |||||
* | | cleanup, replace non-breaking spaces with spaces | Yves Senn | 2012-10-18 | 1 | -5/+5 |
|/ | |||||
* | Use the `flat_map` method. | Rafael Mendonça França | 2012-10-03 | 1 | -2/+2 |
| | | | | Thanks to @jeremy to teach me this one. | ||||
* | Revert "Merge pull request #7826 from sikachu/master-validators-kind" | Rafael Mendonça França | 2012-10-02 | 1 | -14/+1 |
| | | | | | | | | | | | | | | | | This reverts commit 4e9f53f9736544f070e75e516c71137b7eb49a7a, reversing changes made to 6b802cdb4f5b84e1bf49aaeb0e994b3be6028af9. Revert "Don't use tap in this case." This reverts commit 454d820bf0a18fe1db4c55b0145197d70fef1f82. Reason: Is not a good idea to add options to this method since we can do the same thing using method composition. Person.validators_on(:name).select { |v| v.kind == :presence } Also it avoids to change the method again to add more options. | ||||
* | Don't use tap in this case. | Rafael Mendonça França | 2012-10-02 | 1 | -5/+7 |
| | | | | | The use of tap in this case is very confusing since we are mutating the return value inside the block | ||||
* | Make `.validators_on` accept `:kind` option | Prem Sichanugrist | 2012-10-02 | 1 | -1/+12 |
| | | | | | This will filter out the validators on a particular attribute based on its kind. | ||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-08-04 | 1 | -35/+126 |
|\ | | | | | | | | | | | Conflicts: activemodel/lib/active_model/secure_password.rb activerecord/lib/active_record/associations/collection_proxy.rb | ||||
| * | update ActiveModel::Validations docs [ci skip] | Francesco Rodriguez | 2012-07-29 | 1 | -35/+126 |
| | | |||||
* | | load active_support/core_ext/class/attribute in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 |
|/ | |||||
* | Set hash value instead of merge a single key, and use flatten! if possible | Carlos Antonio da Silva | 2012-06-26 | 1 | -2/+1 |
| | | | | | | | | 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. | ||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-06-22 | 1 | -2/+15 |
|\ | |||||
| * | fixes a few mistakes in api docs [ci skip] | Vijay Dev | 2012-06-22 | 1 | -1/+1 |
| | | |||||
| * | add example to ActiveModel::Validations#validators [ci skip] | Francesco Rodriguez | 2012-06-15 | 1 | -2/+15 |
| | | |||||
* | | Simplify AR configuration code. | Jon Leighton | 2012-06-15 | 1 | -2/+1 |
|/ | | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc. | ||||
* | Kill whitespaces :scissors: | Carlos Antonio da Silva | 2012-05-15 | 1 | -2/+2 |
| | |||||
* | clean the erros if an object that includes validations errors is duped. ↵ | Angelo Capilleri | 2012-05-13 | 1 | -0/+6 |
| | | | | Fixes #5953 | ||||
* | minor docs improvements | Oscar Del Ben | 2012-04-26 | 1 | -1/+1 |
| | |||||
* | Add documentation for validate options | Oscar Del Ben | 2012-04-26 | 1 | -0/+13 |
| | |||||
* | Enhance validations documentation | Oscar Del Ben | 2012-04-26 | 1 | -1/+1 |
| | |||||
* | replacing ordered hash to ruby hash | prasath | 2012-02-08 | 1 | -1/+1 |
| | |||||
* | Remove Array.wrap call in ActiveModel | Rafael Mendonça França | 2012-01-06 | 1 | -2/+1 |
| | |||||
* | Support configuration on ActiveRecord::Model. | Jon Leighton | 2011-12-28 | 1 | -2/+3 |
| | | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present. | ||||
* | Remove extra white spaces on ActiveModel docs. | Sebastian Martinez | 2011-05-23 | 1 | -1/+1 |
| | |||||
* | :if should not fire on validations when not in context with :on | Aditya Sanghi | 2011-04-29 | 1 | -1/+1 |
| | |||||
* | formatting changes | Vijay Dev | 2011-03-07 | 1 | -3/+3 |
| | |||||
* | copy-edits 8d96b89 | Xavier Noria | 2011-02-21 | 1 | -2/+2 |
| | |||||
* | Clarification of ActiveRecord ActiveModel validation documentation | Peer Allan | 2011-02-18 | 1 | -2/+2 |
| | |||||
* | Use map + flatten here | Santiago Pastorino | 2011-02-07 | 1 | -3/+3 |
| | |||||
* | Find all validators for multiple attributes | Carl Lerche | 2011-02-05 | 1 | -2/+4 |
| | |||||
* | Use run_callbacks; the generated _run_<name>_callbacks method is not a ↵ | John Firebaugh | 2011-01-31 | 1 | -1/+1 |
| | | | | | | public interface. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | Tests and docs which explain the use of validate with a block and without ↵ | Santiago Pastorino | 2010-12-19 | 1 | -1/+11 |
| | | | | arguments | ||||
* | Fix syntax error in ActiveModel::Validations .validate example | fastred | 2010-10-01 | 1 | -1/+1 |
| | |||||
* | Fixing documentation to reflect deprecated add_to_base | Mikel Lindsaar | 2010-09-12 | 1 | -2/+2 |
| | |||||
* | Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵ | Santiago Pastorino | 2010-08-14 | 1 | -16/+16 |
| | | | | 's/[ \t]*$//' -i {} \;) | ||||
* | Add missing ActiveModel::Validations require | Greg Campbell | 2010-08-12 | 1 | -0/+1 |
| | | | | | | | | | | | [#5311 state: resolved] ActiveModel::Validations uses Hash#except, but does not require it from ActiveSupport. (This wasn't showing up in the tests, because it was required in the helper, and was also required in ActiveModel::Serialization). Signed-off-by: José Valim <jose.valim@gmail.com> |