Changeset 4282
- Timestamp:
- 04/26/06 21:49:41 (2 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/option_merger.rb (modified) (1 diff)
- trunk/activesupport/test/option_merger_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r4276 r4282 1 1 *SVN* 2 3 * Allow default options in with_options to be overridden. Closes #4480. [murphy@cYcnus.de] 2 4 3 5 * Added Module#alias_method_chain [Jamis Buck] trunk/activesupport/lib/active_support/option_merger.rb
r3314 r4282 16 16 17 17 def merge_argument_options!(arguments) 18 arguments << if arguments.last.respond_to? : merge!19 arguments.pop.dup.merge!(@options)18 arguments << if arguments.last.respond_to? :to_hash 19 @options.merge(arguments.pop) 20 20 else 21 21 @options.dup trunk/activesupport/test/option_merger_test.rb
r3493 r4282 28 28 end 29 29 30 def test_method_with_options_allows_to_overwrite_options 31 local_options = {:hello => 'moon'} 32 assert_equal @options.keys, local_options.keys 33 34 with_options(@options) do |o| 35 assert_equal local_options, method_with_options(local_options) 36 assert_equal @options.merge(local_options), 37 o.method_with_options(local_options) 38 assert_equal local_options, o.method_with_options(local_options) 39 end 40 with_options(local_options) do |o| 41 assert_equal local_options.merge(@options), 42 o.method_with_options(@options) 43 end 44 end 45 30 46 private 31 47 def method_with_options(options = {})