aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-02-24 12:32:16 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-02-24 14:17:47 +0100
commitd61baee52adcd1baebe15f1065a0805857571f19 (patch)
tree58243df5f868fec6c8f69b3a6a5b2a85d54ab944 /activesupport/lib/active_support
parent3007c297d35c4742b9267b31adb5ff7a19e9cda6 (diff)
downloadrails-d61baee52adcd1baebe15f1065a0805857571f19.tar.gz
rails-d61baee52adcd1baebe15f1065a0805857571f19.tar.bz2
rails-d61baee52adcd1baebe15f1065a0805857571f19.zip
Go with #presence_in instead of #present_in -- it doesnt sound quite as good, but the closer relationship to #presence over #present is ultimately worth it
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/object/inclusion.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/inclusion.rb b/activesupport/lib/active_support/core_ext/object/inclusion.rb
index 141f19e7b3..55f281b213 100644
--- a/activesupport/lib/active_support/core_ext/object/inclusion.rb
+++ b/activesupport/lib/active_support/core_ext/object/inclusion.rb
@@ -16,12 +16,12 @@ class Object
# Returns the receiver if it's included in the argument otherwise returns +nil+.
# Argument must be any object which responds to +#include?+. Usage:
#
- # params[:bucket_type].present_in %w( project calendar )
+ # params[:bucket_type].presence_in %w( project calendar )
#
# This will throw an ArgumentError if the argument doesn't respond to +#include?+.
#
# @return [Object]
- def present_in(another_object)
+ def presence_in(another_object)
self.in?(another_object) ? self : nil
end
end