Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Remove unused parameter from method | Jon Moss | 2016-02-17 | 1 | -2/+2 |
| | | | | | | The `attribute` parameter is not used inside the `normalize_detail` method. This does not need to go through a deprecation cycle, since the method is private. | ||||
* | Add documentation about method to describe how it works [ci skip] | Mehmet Emin İNAÇ | 2016-02-04 | 1 | -0/+9 |
| | |||||
* | `ActiveRecord::Base#becomes` should copy the errors | Vokhmin Alexey V | 2015-12-14 | 1 | -0/+12 |
| | |||||
* | File encoding is defaulted to utf-8 in Ruby >= 2.1 | Akira Matsuda | 2015-09-18 | 1 | -2/+0 |
| | |||||
* | formatting changes | unknown | 2015-05-29 | 1 | -3/+3 |
| | |||||
* | Adds/Corrects use case for adding an error message | Zamith | 2015-05-04 | 1 | -1/+1 |
| | | | | | I believe this is a use case that was supposed to be supported, and it's a small fix. | ||||
* | Merge pull request #19021 from morgoth/activemodel-errors-refactoring | Rafael Mendonça França | 2015-03-30 | 1 | -24/+4 |
|\ | | | | | Simplify and alias ActiveModel::Errors methods where possible | ||||
| * | Simplify and alias ActiveModel::Errors methods where possible | Wojciech Wnętrzak | 2015-02-20 | 1 | -24/+4 |
| | | |||||
* | | Fix ActiveModel::Errors#delete return value to stay backward compatible | Radan Skoric | 2015-03-22 | 1 | -7/+7 |
| | | | | | | | | | | | | | | | | | | | | | | | | Rails 5.0 changes to ActiveModel::Errors include addition of `details` that also accidentally changed the return value of `delete`. Since there was no test for that behavior it went unnoticed. This commit adds a test and fixes the regression. Small improvements to comments have also been made. Since `get` is getting deprecated it is better to use `[]` in other methods' code examples. Also, in the module usage example, `def Person.method` was replaced with a more commonly used `def self.method` code style. | ||||
* | | Fix ActiveModel::Errors deprecation messages failing when used on its own | Radan Skoric | 2015-03-21 | 1 | -0/+1 |
| | | | | | | | | | | | | Deprecation messages in ActiveModel::Errors are using String#squish from ActiveSupport but were not explicitly requiring it, causing failures when used outside rails. | ||||
* | | Merge pull request #19077 from robin850/unknown-attribute-error | Sean Griffin | 2015-03-02 | 1 | -0/+11 |
|\ \ | | | | | | | Move `UnknownAttributeError` to a more sane namespace | ||||
| * | | Follow-up to #10776 | Robin Dupret | 2015-02-26 | 1 | -0/+11 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name `ActiveModel::AttributeAssignment::UnknownAttributeError` is too implementation specific so let's move the constant directly under the ActiveModel namespace. Also since this constant used to be under the ActiveRecord namespace, to make the upgrade path easier, let's avoid raising the former constant when we deal with this error on the Active Record side. | ||||
* | | | Removed non-standard and unused require 'active_support/deprecation' from ↵ | Vipul A M | 2015-02-27 | 1 | -1/+0 |
|/ / | | | | | | | parts out of active_support. | ||||
* / | Change the deprecation messages to show the preferred way to work with | Rafael Mendonça França | 2015-02-20 | 1 | -6/+6 |
|/ | | | | ActiveModel::Errors | ||||
* | Merge pull request #18996 from morgoth/deprecate-more-errors-methods | Yves Senn | 2015-02-19 | 1 | -0/+16 |
|\ | | | | | | | Deprecate `ActiveModel::Errors` `add_on_empty` and `add_on_blank` methods | ||||
| * | Deprecate `ActiveModel::Errors` `add_on_empty` and `add_on_blank` methods | Wojciech Wnętrzak | 2015-02-19 | 1 | -0/+14 |
|/ | | | | without replacement. | ||||
* | Deprecate `ActiveModel::Errors` `get`, `set` and `[]=` methods. | Wojciech Wnętrzak | 2015-02-01 | 1 | -9/+28 |
| | | | | They have inconsistent behaviour currently. | ||||
* | Fixed duplicating ActiveModel::Errors#details | Wojciech Wnętrzak | 2015-01-24 | 1 | -1/+2 |
| | |||||
* | Add ActiveModel::Errors#details | Wojciech Wnętrzak | 2015-01-20 | 1 | -20/+37 |
| | | | | | | | | | | | | | | | | 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}]} ``` | ||||
* | Fix error messages scope [skip ci] | Anton Davydov | 2015-01-12 | 1 | -2/+2 |
| | |||||
* | Fix inaccurate docs in active_model errors [ci skip] | Robson Marques | 2014-12-22 | 1 | -2/+2 |
| | | | | | | | | | | | | | | The default value for the argument `message` in `ActiveModel::Errors#add` has a new behavior since ca99ab2481d44d67bc392d0ec1125ff1439e9f94. Before person.errors.add(:name, nil) # => ["is invalid"] After person.errors.add(:name, nil) # => [nil] | ||||
* | Add #key? to ActiveModel::Errors | Garry Shutler | 2014-10-14 | 1 | -0/+2 |
| | | | | Mirror Ruby's Hash#key? | ||||
* | Using `each_with_object` instead of `reduce` | Attila Domokos | 2014-08-22 | 1 | -2/+2 |
| | | | | | This way no new object allocation is taking place. Thanks @jeremy for the suggestion! | ||||
* | Replacing an each with reduce | Attila Domokos | 2014-08-21 | 1 | -4/+2 |
| | | | | | | | | The functionality has not changed, but the code is more elegant by using `reduce` instead of `each`. This way no accumulator needs to be declared, no explicit return is needed. | ||||
* | Merge pull request #15889 from carnesmedia/model-name | Rafael Mendonça França | 2014-08-17 | 1 | -1/+1 |
|\ | | | | | | | Use #model_name on instances instead of classes | ||||
| * | Use #model_name on instances instead of classes | Amiel Martin | 2014-06-24 | 1 | -1/+1 |
| | | | | | | | | | | | | This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8 | ||||
* | | [ci skip] Little bit doc code improvement. | Santosh Wadghule | 2014-07-14 | 1 | -1/+1 |
|/ | |||||
* | Adds explanation of :base attribute to errors.add | David Underwood | 2014-03-27 | 1 | -0/+7 |
| | | | [ci skip] | ||||
* | Fix ActiveModel::Errors#has_key? return value | Adrien Coquio | 2014-01-22 | 1 | -1/+1 |
| | |||||
* | Change all "can not"s to the correct "cannot". | T.J. Schuck | 2014-01-03 | 1 | -20/+20 |
| | |||||
* | Fix few typos and improve markup at some levels | Robin Dupret | 2013-12-24 | 1 | -2/+2 |
| | |||||
* | Fix: documentation for ActiveModel::Errors | Ryoji Yoshioka | 2013-08-05 | 1 | -4/+4 |
| | |||||
* | fix typo in ActiveModel::Error docs [ci skip] | Steven Yang | 2013-06-30 | 1 | -1/+1 |
| | |||||
* | make default value for `:message` on `AM::Errors` explicit. | Yves Senn | 2013-06-22 | 1 | -4/+2 |
| | |||||
* | Convert ActiveModel to 1.9 hash syntax. | Patrick Robertson | 2013-05-01 | 1 | -9/+9 |
| | | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ). | ||||
* | Improve changelog entry for ActiveModel::Errors#full_messages_for [ci skip] | Carlos Antonio da Silva | 2013-03-30 | 1 | -2/+0 |
| | | | | Add a working example of how to use this new method. | ||||
* | Add a method full_messages_for to the Errors class | shock_one | 2013-03-24 | 1 | -0/+14 |
| | |||||
* | Revert the change at ActiveModel::Errors#add_on_blank and fix in the | Rafael Mendonça França | 2012-12-26 | 1 | -7/+1 |
| | | | | | | | | | | | right place. The EachValidator#validate already handle :allow_blank and :allow_nil, correctly. Closes #8622. Fix #8621. | ||||
* | Tests and fix for validates_presence of :allow_nil, :allow_blank | Colin Kelley | 2012-12-26 | 1 | -1/+7 |
| | | | | | Conflicts: activemodel/lib/active_model/errors.rb | ||||
* | Remove ActiveModel::Errors#add_on_present method. | Rafael Mendonça França | 2012-12-21 | 1 | -13/+0 |
| | | | | | | | | We don't need to define a new method in ActiveMode::Errors for each validatior. See https://github.com/rails/rails/commit/d72a07f1d1478db9daed847eadb35bfd840674f6#commitcomment-2325333 | ||||
* | Add `ActiveModel::Validations::AbsenceValidator`, a validator to check the ↵ | Roberto Vasquez Angel | 2012-12-15 | 1 | -0/+13 |
| | | | | | | absence of attributes. Add `ActiveModel::Errors#add_on_present` method. Adds error messages to present attributes. | ||||
* | Replace comments' non-breaking spaces with spaces | claudiob | 2012-12-04 | 1 | -3/+3 |
| | | | | | | | | | | Sometimes, on Mac OS X, programmers accidentally press Option+Space rather than just Space and don’t see the difference. The problem is that Option+Space writes a non-breaking space (0XA0) rather than a normal space (0x20). This commit removes all the non-breaking spaces inadvertently introduced in the comments of the code. | ||||
* | use Array() instead flatten | Vasiliy Ermolovich | 2012-11-05 | 1 | -2/+2 |
| | | | | | * move ActiveModel::Errors tests to errors_test.rb * add spec coverage for add_on_empty and add_on_blank | ||||
* | fix output messages - docs [ci skip] | Francesco Rodriguez | 2012-10-22 | 1 | -16/+16 |
| | |||||
* | convert comments to 1.9 hash syntax | AvnerCohen | 2012-10-22 | 1 | -11/+11 |
| | |||||
* | minor edits in AM documentation [ci skip] | Francesco Rodriguez | 2012-10-21 | 1 | -1/+1 |
| | |||||
* | AM::Validation#validates: ability to pass custom exception to `:strict` option | Bogdan Gusiev | 2012-08-06 | 1 | -2/+6 |
| | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-08-04 | 1 | -0/+13 |
|\ | | | | | | | | | | | Conflicts: activemodel/lib/active_model/secure_password.rb activerecord/lib/active_record/associations/collection_proxy.rb | ||||
| * | add example to ActiveModel::StrictValidationFailed [ci skip] | Francesco Rodriguez | 2012-07-28 | 1 | -0/+13 |
| | | |||||
* | | load active_support/core_ext/object/blank in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 |
|/ |