aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/option_merger.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use match? where we don't need MatchDataAkira Matsuda2019-07-271-1/+1
| | | | We're already running Performance/RegexpMatch cop, but it seems like the cop is not always =~ justice
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-1/+1
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-1/+1
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix error when using `with_options` with lambda.Lauro Caetano2014-04-031-1/+1
| | | | | | | | | | | | | | | | | | | 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
* Explicit dependency on Hash#deep_merge extensionJeremy Kemper2009-03-281-0/+2
|
* Added lambda merging to OptionMerger (especially useful with named_scope and ↵David Heinemeier Hansson2008-11-151-1/+7
| | | | with_options) [#740 state:committed] (Paweł Kondzior)
* Get rid of 'Object#send!'. It was originally added because it's in Ruby 1.9, ↵Jeremy Kemper2008-08-311-1/+1
| | | | | | | | | | but it has since been removed from 1.9. Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> Conflicts: actionpack/test/controller/layout_test.rb
* Allow deep merging of hash values for nested with_options. [#490 state:resolved]Lawrence Pit2008-07-171-9/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* send -> send! for some private methodsJeremy Kemper2007-09-271-6/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7659 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Some 1.9 forward compatibilityJeremy Kemper2007-09-141-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't undefine #class in OptionMerger [Rick]Rick Olson2006-09-271-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5197 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow default options in with_options to be overridden. Closes #4480. ↵Marcel Molina2006-04-261-2/+2
| | | | | | [murphy@cYcnus.de] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4282 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add Object#with_options for DRYing up multiple calls to methods having ↵Sam Stephenson2005-12-151-0/+25
shared options git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3314 5ecf4fe2-1ee6-0310-87b1-e25e094e27de