rails/activerecord/test/cases
Philippe Huibonhoa 359adaedd9 Fixed where for polymorphic associations when passed an array containing different types.
When passing in an array of different types of objects to `where`, it would only take into account the class of the first object in the array.

    PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)])
	# => SELECT "price_estimates".* FROM "price_estimates"
         WHERE ("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" IN (1, 2))

This is fixed to properly look for any records matching both type and id:

    PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)])
    # => SELECT "price_estimates".* FROM "price_estimates"
         WHERE (("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" = 1)
         OR ("price_estimates"."estimate_of_type" = 'Car' AND "price_estimates"."estimate_of_id" = 2))
2016-02-16 10:41:26 -08:00
..
adapters Typos in AR tests 2016-02-03 22:08:13 +09:00
associations rename to 'second_to_last' and 'third_to_last' 2016-02-10 10:10:38 -08:00
attribute_methods Attribute assignment and type casting has nothing to do with columns 2015-01-31 19:42:38 -07:00
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 #23614 from georgemillo/foreign_key 2016-02-16 11:54:49 +01:00
relation Fixed where for polymorphic associations when passed an array containing different types. 2016-02-16 10:41:26 -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 UniquenessValidator exclude itself when PK changed 2016-02-09 21:28:21 -02: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 type_cast_from_user -> cast 2015-02-17 13:39:42 -07:00
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 Changed options for find_each and variants to have options start/finish instead of start_at/end_at based on comments 2016-01-18 12:40:30 +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 legacy mysql adapter 2015-12-21 08:46:55 +09: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 pretty_print will use #inspect if a subclass redefines it 2015-01-12 15:17:32 -08:00
counter_cache_test.rb Fix counter_cache for polymorphic associations 2015-07-19 15:52:29 -06: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 Fix a false assertion 2015-01-17 08:09:41 -08:00
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 Silence warning from MySQL::Error object in test 2015-04-23 17:05:03 -04:00
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 Merge pull request #23377 from bogdan/last-with-sql 2016-02-13 09:45:04 -05: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 Closes rails/rails#18864: Renaming transactional fixtures to transactional tests 2015-03-16 11:35:44 -07:00
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 Merge branch 'master' of github.com:rails/docrails 2016-02-07 07:14:50 +00:00
migrator_test.rb Internal test migrations use the private 'Current' version 2015-12-15 17:18:09 +10:30
mixin_test.rb remove unnecessary rescue 2015-03-05 15:05:47 -08:00
modules_test.rb remove old unavailable link with relevant fix 2015-03-23 11:18:14 +05:30
multiparameter_attributes_test.rb Push multi-parameter assignement into the types 2015-02-07 13:52:23 -07:00
multiple_db_test.rb Closes rails/rails#18864: Renaming transactional fixtures to transactional tests 2015-03-16 11:35:44 -07:00
nested_attributes_test.rb Don't short-circuit reject_if proc 2016-01-22 15:00:50 -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 duplicated composite primary key tests 2016-02-01 11:20:30 +09:00
query_cache_test.rb Removed mocha from Active Record Part 1 2015-08-25 22:07:25 +05:30
quoting_test.rb Refactor microsecond precision to be database agnostic 2015-02-10 11:55:59 -07:00
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 Introduce ActiveRecord::IrreversibleOrderError 2016-01-27 12:53:51 +02: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 Typos in AR tests 2016-02-04 17:24:00 +09:00
suppressor_test.rb Apply Active Record suppression to all saves 2015-06-04 00:11:38 -04: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 Further remove reliance on subsecond precision in tests 2015-09-23 09:43:19 -06: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 Closes rails/rails#18864: Renaming transactional fixtures to transactional tests 2015-03-16 11:35:44 -07:00
transactions_test.rb Allow add_to_transaction with null transaction 2015-12-28 14:28:19 -08:00
type_test.rb Add a global type registry, used to lookup and register types 2015-02-15 14:22:08 -07:00
types_test.rb Move the appropriate type tests to the Active Model suite 2015-09-21 10:12:31 -06:00
unconnected_test.rb Closes rails/rails#18864: Renaming transactional fixtures to transactional tests 2015-03-16 11:35:44 -07:00
validations_repair_helper.rb
validations_test.rb validates_acceptance_of shouldn't require a database connection 2015-09-25 07:54:38 -06:00
view_test.rb Remove legacy mysql adapter 2015-12-17 15:54:57 +00:00
yaml_serialization_test.rb Add YAML compatibility for objects from Rails 4.2 2015-03-10 11:56:45 -06:00