1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/lib/active_support
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
..
cache - Rename increment_or_decrement to an apt set_cache_value since it actually doesn't increment/decrement in localstore. 2014-03-24 22:11:23 +05:30
concurrency
core_ext Move require to actual file 2014-04-02 13:17:21 -03:00
dependencies
deprecation
inflector speed up underscore in cases that don't need to do anything 2014-02-26 15:09:18 -08:00
json Add support for JSON time_precision to Time and DateTime 2014-01-26 21:25:54 +00:00
locale
log_subscriber
multibyte Fix tidy_bytes for JRuby 2014-02-10 08:10:44 -06:00
notifications
number_helper fix number_to_percentage with Float::NAN, Float::INFINITY. 2014-03-17 10:55:21 +01:00
testing use method_defined? to check whether or not a method is defined 2014-03-12 13:34:07 -07:00
values make tests pass on Ruby 2.2 2014-03-13 10:55:52 -07:00
xml_mini
all.rb
backtrace_cleaner.rb Some assorted fixes for the 4.1 release notes: 2013-12-17 08:39:07 -08:00
benchmarkable.rb
builder.rb
cache.rb Revert "Merge pull request #14269 from arthurnn/expanded_key_array" 2014-03-04 17:58:58 -08:00
callbacks.rb Fix few typos in the documentation [ci skip] 2013-12-21 18:59:55 +01:00
concern.rb Introduce Concern#class_methods and Kernel#concern 2014-02-23 12:06:23 -07:00
configurable.rb Make sure multiline string is not accepted by the regexp 2013-12-19 17:28:19 -02:00
core_ext.rb
dependencies.rb Merge branch 'master' of github.com:rails/docrails 2014-02-09 23:33:55 +05:30
deprecation.rb
descendants_tracker.rb
duration.rb Fix segmentation fault in Ruby 2.0.0-p353. 2013-11-30 15:12:12 +02:00
file_update_checker.rb
file_watcher.rb
gem_version.rb Introduce Rails.gem_version 2014-03-05 12:37:38 -05:00
gzip.rb
hash_with_indifferent_access.rb HashWithIndifferentAccess better respects #to_hash 2014-03-28 10:25:06 -04:00
i18n.rb
i18n_railtie.rb Fix typo [ci skip] 2013-12-21 15:03:32 -02:00
inflections.rb docs, hide inflector comment targeting only contributors. [ci skip] 2014-02-11 09:08:16 +01:00
inflector.rb
json.rb
key_generator.rb Fix secrets.yml path in exception message 2014-01-20 08:58:43 -02:00
lazy_load_hooks.rb
log_subscriber.rb
logger.rb Remove deprecated cattr_* requires 2013-12-03 00:28:15 +02:00
logger_silence.rb
message_encryptor.rb Allow session serializer key in config.session_store 2014-01-29 17:05:00 +01:00
message_verifier.rb PR #10635 introduces rescue from ArgumentError thrown by Base64.strict_decode64. 2013-12-12 22:15:42 +05:30
multibyte.rb
notifications.rb
number_helper.rb Nodoc missing number helper classes in AS [ci skip] 2013-12-11 20:01:54 -02:00
option_merger.rb Fix error when using with_options with lambda. 2014-04-03 10:26:37 -03:00
ordered_hash.rb Fix OrderedHash.select to return self instance. 2014-03-07 12:30:20 -05:00
ordered_options.rb
per_thread_registry.rb Perf: save ~9% of object allocations on heavy requests. 2013-12-12 18:53:32 -07:00
proxy_object.rb
rails.rb
railtie.rb
rescuable.rb
string_inquirer.rb
subscriber.rb
tagged_logging.rb added missing require 2013-12-02 19:52:01 +01:00
test_case.rb
time.rb
time_with_zone.rb Maintain the current timezone in wrap_with_time_zone 2014-01-31 17:13:12 +00:00
version.rb Introduce Rails.gem_version 2014-03-05 12:37:38 -05:00
xml_mini.rb Fix breakage in XmlMini 2013-12-23 14:04:16 +09:00