| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Follow-Up to https://github.com/rails/rails/pull/14348
Ensure that SQLCounter.clear_log is called after each test.
This is a step to prevent side effects when running tests. This will allow us to run them in random order.
|
|
|
|
| |
please pass the id of the AR object by calling `.id` on the model first.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
laurocaetano/fix-uniqueness-validation-for-aliased-attribute
Fix bug when validating the uniqueness of an aliased attribute.
Conflicts:
activerecord/CHANGELOG.md
|
| |
|
|
|
|
| |
test/cases/validations/i18n_generate_message_validation_test.rb and test/cases/validations/uniqueness_validation_test.rb
|
|
|
|
|
|
|
| |
We can conditional define the tests depending on the adapter or
connection.
Lets keep the skip for fail tests that need to be fixed.
|
| |
|
|
|
|
|
|
|
|
| |
This behaviour doesn't actually make sense, the context of
the child should not be affected by the parent. See #10492.
This reverts commit 5f8274efe128ffeec8fa3179460f5167a078f007, reversing
changes made to 81e837e810460d066a2e5fc5a795366ec8ab2313.
|
| |
|
| |
|
|
|
|
| |
Take the opportunity to showcase where.not.
|
|
|
|
|
| |
This is a follow up to #5321 and follows the general direction in
AR to make things lazy evaluated.
|
|
|
|
| |
Fixes: #8075.
|
|
|
|
|
|
| |
activerecord scope.
Related with 5341b84936d93ec90e6252af437a3871101c115a
|
|
|
|
|
|
| |
Moved activerecord.errors.messages.taken to errors.messages.taken so that translations for, e.g., errors.attributes.email.taken don't get overridden.
Test that the translation for 'taken' can be overridden
|
|
|
|
| |
Would incorrectly add duplicated errors when the association was blank. Bug introduced in 1fab518c6a75dac5773654646eb724a59741bc13.
|
| |
|
| |
|
|\
| |
| | |
Validates_presence_of associated object marked for destruction
|
| |
| |
| |
| |
| |
| |
| | |
This allows us to mark the parent object as invalid if all associated objects
in a presence validated association are marked for destruction.
See: https://github.com/rails/rails/issues/6812
|
| |
| |
| |
| |
| |
| |
| | |
It doesn't serve much purpose now that ActiveRecord::Base.all returns a
Relation.
The code is moved to active_record_deprecated_finders.
|
|/
|
|
|
|
| |
Fixes issue with overrding ActiveRecord reader methods with a
composed object and using that attribute as the scope of a
validates_uniqueness_of validation.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
activerecord/test/cases/validations/i18n_generate_message_validation_test.rb
|
|
|
|
| |
namespace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
E.G.:
```ruby
class Parent < ActiveRecord::Base
has_one :child
validates_presence_of :name, :on => "custom_context"
validates_associated :child
end
class Child < ActiveRecord::Base
belongs_to :parent
validates_presence_of :name, :on => "custom_context"
end
p = Parent.new(:name => "Montoto", :child => Child.new)
p.valid?(:custom_context) # => Returns true, even though the child is not valid under the same context.
```
|
|
|
| |
#4321
|
|
|
| |
#4321
|
| |
|
|
|
|
|
|
|
| |
It breaks the build for mysql.
This reverts commit 958d25df4a1b0d41ce5deeeb0739c93b49bbd18d, reversing
changes made to 8f309e31057e1b26fefedb199ab0526126fb1fe4.
|
| |
|
|
|
|
| |
Testing Sandbox removed.
|
|
|
|
|
|
| |
The main reason for this change is to fix a bug where
`validates_associated` would prevent `accepts_nested_attributes_for`
with `allow_destroy: true` from destroying invalid associated records.
|
| |
|
|
|
|
| |
RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
|
|
|
| |
It can result in wrong results if values contain special % or _ characters. It is safer to use SQL LOWER function and compare for equality.
|
| |
|
| |
|
|
|
|
|
|
| |
[#5153 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hash and make various Validators pass their (filtered) options.
This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format".
Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation.
Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options).
Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now.
The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet.
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
| |
for I18n
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: wycats <wycats@gmail.com>
|