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
Lauro Caetano db5d26c9d7 Fix error when using with_options with lambda.
It was causing error when using `with_options` passing a lambda as its
last argument.

    class User < ActiveRecord::Base
      with_options dependent: :destroy do |assoc|
        assoc.has_many :profiles, -> { where(active: true) }
      end
    end

It was happening because the `option_merger` was taking the last
argument and checking if it was a Hash. This breaks the HasMany usage,
because its last argument can be a Hash or a Proc.

As the behavior described in this test:
https://github.com/rails/rails/blob/master/activesupport/test/option_merger_test.rb#L69
the method will only accept the lambda, this way it will keep the expected behavior. See 9eaa0a34
2014-04-03 10:26:37 -03:00
..
adapters Merge pull request #14561 from tgxworld/refactor_run_without_connection 2014-04-03 10:48:27 +02:00
associations Fix error when using with_options with lambda. 2014-04-03 10:26:37 -03:00
attribute_methods
coders
connection_adapters Reap connections based on owning-thread death 2014-03-18 10:33:00 +10:30
connection_specification
fixture_set
migration Use teardown helper method. 2014-03-14 20:48:59 -07:00
relation use ARel factory methods for building AST nodes 2014-03-24 17:24:20 -07:00
scoping do not rely on method_missing hitting arel 2014-03-24 17:38:18 -07:00
tasks
validations Use teardown helper method. 2014-03-14 20:48:59 -07:00
adapter_test.rb We can conditional define the tests depending on the adapter or 2014-04-02 16:19:57 +05:30
aggregations_test.rb
ar_schema_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
associations_test.rb Calling reset on a collection association should unload the assocation 2014-01-21 18:24:28 -08:00
attribute_methods_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
autosave_association_test.rb Revert "Merge pull request #8313 from alan/only_save_changed_has_one_objects" 2014-03-25 15:09:48 -03:00
base_test.rb Ensure we are returning either true or false for #== 2014-03-29 04:34:20 -07:00
batches_test.rb Return sized enumerator from Batches#find_each 2014-02-05 16:53:02 -05:00
binary_test.rb
bind_parameter_test.rb Merge pull request #14524 from tgxworld/fix_unsubscribe_from_notifications 2014-03-29 14:53:29 +01:00
calculations_test.rb Ensure AR #second, #third, etc. finders work through associations 2014-01-21 19:35:27 -05:00
callbacks_test.rb
clone_test.rb
column_alias_test.rb
column_definition_test.rb PostgreSQL determine Column#type through corresponding OID. #7814 2014-04-01 09:54:32 +02:00
column_test.rb
connection_management_test.rb set encoding to binmode for pipe 2014-01-17 16:49:10 -05:00
connection_pool_test.rb test should only pass if the pool.size+1 checkout fails 2014-03-17 17:37:05 -07:00
core_test.rb
counter_cache_test.rb
custom_locking_test.rb
database_statements_test.rb
date_time_test.rb
defaults_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
dirty_test.rb
disconnected_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
dup_test.rb
enum_test.rb Fix a bug affecting validations of enum attributes 2014-02-27 23:54:49 +02:00
explain_subscriber_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
explain_test.rb
finder_respond_to_test.rb Fixed a bug in AR::Base#respond_to? 2014-01-29 10:53:48 -08:00
finder_test.rb Add test for deprecation warning for passing an AR object to find. 2014-03-13 16:10:04 -03:00
fixtures_test.rb Extend fixture label replacement to allow string interpolation 2014-03-15 22:11:36 -04:00
forbidden_attributes_protection_test.rb
habtm_destroy_order_test.rb
helper.rb Refactor test to use DdlHelper. 2014-03-29 09:43:19 -07:00
hot_compatibility_test.rb
i18n_test.rb
inheritance_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
integration_test.rb Fix test for cache_key + touched 2014-01-16 09:05:55 -02:00
invalid_connection_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
invalid_date_test.rb
invertible_migration_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
json_serialization_test.rb
locking_test.rb Correctly send the string given to lock! and reload(:lock) to the lock scope - fixes #13788 2014-01-29 12:37:00 -03:00
log_subscriber_test.rb
migration_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
migrator_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
mixin_test.rb Remove automatic removal of Date/Time stubs after each test case 2014-01-30 10:17:48 -02:00
modules_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
multiparameter_attributes_test.rb
multiple_db_test.rb
nested_attributes_test.rb Remove extra indirection for testing exceptions and messages 2014-03-20 08:40:32 -03:00
nested_attributes_with_callbacks_test.rb
persistence_test.rb Change usec to 0 on tests that compare seconds 2014-03-12 11:52:39 -04:00
pooled_connections_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
primary_keys_test.rb docs, AR already auto-detects primary keys. Closes #13946. [ci skip] 2014-02-05 08:52:59 +01:00
query_cache_test.rb Make select_all on query cache accept a Relation without binds. 2014-03-13 15:01:37 -04:00
quoting_test.rb
readonly_test.rb
reaper_test.rb Reap connections based on owning-thread death 2014-03-18 10:33:00 +10:30
reflection_test.rb
relation_test.rb
relations_test.rb where.not adds references for includes. 2014-03-17 14:20:23 +01:00
reload_models_test.rb
result_test.rb Return sized enumerator from Batches#find_each 2014-02-05 16:53:02 -05:00
sanitize_test.rb add activerecord test coverage for sanitize_sql_array 2014-02-09 12:05:42 +00:00
schema_dumper_test.rb register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester] 2014-03-11 08:14:03 +11:00
serialization_test.rb
serialized_attribute_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
statement_cache_test.rb
store_test.rb Aesthetic 2014-01-29 20:48:43 -02:00
test_case.rb refactor assert_sql query to reuse capture_sql 2014-03-31 22:56:39 -04:00
timestamp_test.rb Merge pull request #14469 from tiegz/timestamp_inheritance_fix 2014-03-27 18:18:45 -03:00
transaction_callbacks_test.rb Make sure transaction state resets after commit 2014-02-03 15:49:48 -05:00
transaction_isolation_test.rb
transactions_test.rb AR .persisted? throws SystemStackError for an unsaved model with a 2014-03-27 15:01:31 -03:00
unconnected_test.rb Use teardown helper method. 2014-03-14 20:48:59 -07:00
validations_repair_helper.rb
validations_test.rb ActiveRecord/ActiveModel '#validate' alias for 'valid?' 2014-03-27 17:56:14 +01:00
xml_serialization_test.rb require dependency to execute a single test from xml_serialization_test 2014-03-27 12:00:10 +01:00
yaml_serialization_test.rb