1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/lib/active_model
eileencodes 2c02bc0a47 Revert changes to validations from PR #18612
In order to fix issue #17621 we added a check to validations that
determined if a record should be validated. Based on the existing tests
and behavior we wanted we determined the best way to do that was by
checking if `!record.peristed? || record.changed? || record.marked_for_destruction?`

This change didn't make it into a release until now. When #23790 was
opened we realized that `valid?` and `invalid?` were broken and did not
work on persisted records because of the `!record.persisted?`.

While there is still a bug that #17621 brought up, this change was too
drastic and should not be a RC blocker. I will work on fixing this so
that we don't break `valid?` but also aren't validating parent records
through child records if that parent record is validate false. This
change removes the code changes to validate and the corresponding tests.
It adds tests for two of the bugs found since Rails 5 beta2 release.

Fixes #17621
2016-02-23 15:21:46 -05:00
..
locale Move the validate! method to ActiveModel::Validations. 2015-02-20 16:05:26 -02:00
serializers Eliminate instance level writers for class accessors 2016-01-22 15:02:46 -08:00
type Refactor tz aware types, add support for PG ranges 2016-01-08 14:11:45 -07:00
validations Convert non-Numeric values to Floats 2015-12-22 16:01:50 -05:00
attribute_assignment.rb Update and fix forbidden attributes tests 2015-11-03 11:34:07 -08:00
attribute_methods.rb Require only necessary concurrent-ruby classes. 2015-11-04 21:12:28 -05:00
callbacks.rb Fix the AS::Callbacks terminator regression from 4.2.3 2015-09-22 22:32:56 -04:00
conversion.rb Use Active Model, not ActiveModel in plain English 2015-01-02 14:19:21 -08:00
dirty.rb Merge pull request #22333 from harrykiselev/patch-3 2015-11-21 11:21:20 +01:00
errors.rb Remove unused parameter from method 2016-02-17 16:09:54 -05:00
forbidden_attributes_protection.rb Fix AC::Parameters not being sanitized for query methods. 2015-10-02 16:26:16 +08:00
gem_version.rb Preparing for Rails 5.0.0.beta2 2016-02-01 14:37:52 -07:00
lint.rb Better docs for AM::Lint::Tests 2015-01-07 09:15:47 -08:00
model.rb use attribute assignment module logic during active model initialization 2015-01-23 14:42:47 -08:00
naming.rb use ActiveModel::Naming module instead of Model [ci skip] 2015-10-06 10:46:14 +02:00
railtie.rb Use BCrypt's MIN_COST in the test environment for speedier tests 2012-11-14 09:42:54 -06:00
secure_password.rb Fix spelling error in has_secure_password documentation [ci skip] 2015-03-03 20:05:02 -05:00
serialization.rb [ci skip] Fix explanation of ActiveModel::Serialization 2015-10-02 13:20:19 +09:00
test_case.rb
translation.rb Convert ActiveModel to 1.9 hash syntax. 2013-05-01 18:01:46 -07:00
type.rb Add an immutable string type to opt out of string duping 2015-10-15 09:50:37 -07:00
validations.rb Eliminate instance level writers for class accessors 2016-01-22 15:02:46 -08:00
validator.rb Revert changes to validations from PR #18612 2016-02-23 15:21:46 -05:00
version.rb Use Active Model, not ActiveModel in plain English 2015-01-02 14:19:21 -08:00