1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases
Joe Rafaniello 0379da6abc Fix uniqueness validation with an after_create hook.
record.id_was is nil in after_create/after_save, so we should use
id in these cases.

While this logic feels incomplete, the existing update_record uses the same
logic:
2fda4e0874/activerecord/lib/active_record/relation.rb (L83)

This logic was originally added for a similar problem:
updates not working with after_create hook.

See: 482f8c15b1

Followup to #23581
Fixes #23844
2016-02-25 10:13:12 -05:00
..
adapters Fix NoMethodError preparable for Arel::Visitors in case prepared statements is falsy 2016-02-22 01:19:34 +02:00
associations remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
attribute_methods
coders
connection_adapters Remove accidental additional test 2016-02-04 11:13:05 -08:00
connection_specification Add a resolver test for the missing scheme 2016-02-04 10:59:52 -08:00
fixture_set Merge pull request #20574 from repinel/fix-db-fixtures-load 2015-09-30 11:06:41 +02:00
migration Merge pull request #23419 from prathamesh-sonpatki/fix-showing-of-deprecation-warning-for-legacy-migrations 2016-02-23 14:59:13 +10:30
relation Merge pull request #22365 from phuibonhoa/phuibonhoa/polymorphic_where_multiple_types 2016-02-17 13:56:55 -08:00
scoping Merge pull request #18109 from k0kubun/unscoped-joins 2016-02-11 11:33:30 -07:00
tasks Merge pull request #22967 from schneems/schneems/generic-metadata 2016-01-08 13:42:48 -07:00
type skipped assertion on datetime seconds precision as it is only valid for newer mysql versions 2015-09-24 00:35:50 +05:30
validations Fix uniqueness validation with an after_create hook. 2016-02-25 10:13:12 -05:00
adapter_test.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
aggregations_test.rb
ar_schema_test.rb Make to primary key instead of an unique index for internal tables 2016-01-31 03:26:57 +09:00
associations_test.rb Remove unnecessary require in associations_test.rb 2015-09-03 04:27:07 +09:00
attribute_decorators_test.rb
attribute_methods_test.rb Typos in AR tests 2016-02-04 17:24:00 +09:00
attribute_set_test.rb Implement equality comparison on AttributeSet and friends 2015-10-06 08:52:28 -06:00
attribute_test.rb Further encapsulate dirty checking on Attribute 2015-10-02 08:03:11 -04:00
attributes_test.rb Ensure #reset_column_information clears child classes as well 2015-11-07 08:20:34 -07:00
autosave_association_test.rb Fixed setting errors details on autosaved associations 2015-10-28 20:18:29 +01:00
base_test.rb Typos in AR tests 2016-02-03 22:08:13 +09:00
batches_test.rb Fix semantics of test names for finish option in batches_test 2016-02-17 11:26:03 +05:30
binary_test.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
bind_parameter_test.rb substitute_at is no longer used 2016-01-14 09:59:26 +09:00
cache_key_test.rb fixes #21815 2015-10-16 15:09:45 +02:00
calculations_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
callbacks_test.rb Deprecate passing string to define callback. 2015-12-16 19:56:20 +09:00
clone_test.rb
collection_cache_key_test.rb Fix AR::Relation#cache_key to remove select scope added by user 2016-01-24 22:36:13 +05:30
column_alias_test.rb
column_definition_test.rb Extract MySQL::TypeMetadata class to connection_adapters/mysql/type_metadata.rb 2016-01-11 05:03:31 +09:00
connection_management_test.rb Fix wrong assert_equal argument order. 2015-11-07 11:35:01 +01:00
connection_pool_test.rb Require only necessary concurrent-ruby classes. 2015-11-04 21:12:28 -05:00
core_test.rb
counter_cache_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
custom_locking_test.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
database_statements_test.rb Fix connection#create in PG adapter 2016-01-05 10:02:29 +09:00
date_time_precision_test.rb Consolidate tests for time and datetime columns options, limit and precision 2015-11-30 20:37:45 +00:00
date_time_test.rb
defaults_test.rb Active Record supports MySQL >= 5.0 2016-02-04 07:08:33 +09:00
dirty_test.rb Don't assert fractional seconds can be applied on unsupported adapters 2015-09-24 15:27:59 -06:00
disconnected_test.rb
dup_test.rb
enum_test.rb Use the database type to deserialize enum 2016-01-23 08:44:16 -07:00
errors_test.rb Make ActiveRecordException descendants args optional 2015-09-07 00:04:31 -07:00
explain_subscriber_test.rb Let WITH (CTE) queries be explainable 2015-05-28 14:10:09 +03:00
explain_test.rb Removed mocha from Active Record Part 2 2015-09-16 21:57:10 +05:30
finder_respond_to_test.rb
finder_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
fixtures_test.rb fix regression when loading fixture files with symbol keys. 2016-01-13 10:11:54 +01:00
forbidden_attributes_protection_test.rb Fix more test failures caused by #21000 2015-11-23 15:36:38 -07:00
habtm_destroy_order_test.rb
helper.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
hot_compatibility_test.rb
i18n_test.rb
inheritance_test.rb Do not use default attributes for STI when instantiating a subclass 2016-01-27 13:26:20 -05:00
integration_test.rb fixes #21815 2015-10-16 15:09:45 +02:00
invalid_connection_test.rb tests, don't connect to mysql when running sqlite3 tests. 2015-12-28 09:00:38 +01:00
invalid_date_test.rb
invertible_migration_test.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
json_serialization_test.rb
locking_test.rb Fix test failures caused by 574f255 2015-12-14 09:20:07 -07:00
log_subscriber_test.rb test_binary_data_is_not_logged is for prepared statements logging 2015-11-05 17:39:53 +09:00
migration_test.rb Ensure drop_table even if tests failure or interrupted 2016-02-24 23:15:46 +09:00
migrator_test.rb Internal test migrations use the private 'Current' version 2015-12-15 17:18:09 +10:30
mixin_test.rb
modules_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
multiparameter_attributes_test.rb
multiple_db_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
nested_attributes_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
nested_attributes_with_callbacks_test.rb
persistence_test.rb Typos in AR tests 2016-02-03 22:08:13 +09:00
pooled_connections_test.rb Deprecate #table_exists?, #tables and passing arguments to #talbes 2015-11-09 23:13:23 +09:00
primary_keys_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
query_cache_test.rb Removed mocha from Active Record Part 1 2015-08-25 22:07:25 +05:30
quoting_test.rb
readonly_test.rb Further fix failing tests caused by #21350 2015-08-24 08:10:48 -06:00
reaper_test.rb
reflection_test.rb When verifying size of relation, also verify count is ok. 2016-01-25 13:41:21 +05:30
relation_test.rb activerecord: reuse immutable objects 2016-01-04 12:09:37 -05:00
relations_test.rb Merge pull request #23751 from chezou/add-test-case-order-by-field 2016-02-22 11:50:03 +00:00
reload_models_test.rb fix test not failing when executed isolated 2015-06-19 16:02:12 -03:00
result_test.rb
sanitize_test.rb Merge pull request #22209 from yui-knk/add_test_sanitize_sql_array_handles_named_bind_variables 2015-12-14 07:42:32 -07:00
schema_dumper_test.rb Revert "Dump indexes in create_table instead of add_index" 2016-02-05 13:33:48 -07:00
secure_token_test.rb Revert "Merge pull request #20835 from glittershark/if-and-unless-in-secure-token" 2016-01-14 21:52:03 +01:00
serialization_test.rb Remove XML Serialization from core. 2015-08-07 11:01:48 -04:00
serialized_attribute_test.rb Add a test to ensure serialize persists nil as NULL 2015-06-12 13:50:51 -06:00
statement_cache_test.rb
store_test.rb Test parent local_stored_attributes isn't modified 2016-02-16 11:42:04 -05:00
suppressor_test.rb Ensure suppressor runs before validations 2016-02-24 14:33:22 -05:00
test_case.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
test_fixtures_test.rb 🔪 Typos 2015-09-21 03:17:39 +09:00
time_precision_test.rb Consolidate tests for time and datetime columns options, limit and precision 2015-11-30 20:37:45 +00:00
timestamp_test.rb Fix assert_in_delta test failure 2016-02-06 23:15:22 +09:00
touch_later_test.rb travel back 2015-12-13 11:34:40 +09:00
transaction_callbacks_test.rb Fix corrupt transaction state caused by before_commit exceptions 2016-02-01 14:12:49 -07:00
transaction_isolation_test.rb
transactions_test.rb Allow add_to_transaction with null transaction 2015-12-28 14:28:19 -08:00
type_test.rb
types_test.rb Move the appropriate type tests to the Active Model suite 2015-09-21 10:12:31 -06:00
unconnected_test.rb
validations_repair_helper.rb
validations_test.rb remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
view_test.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
yaml_serialization_test.rb