aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/core_ext
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/core_ext')
-rw-r--r--activesupport/lib/core_ext/hash/indifferent_access.rb10
-rw-r--r--activesupport/lib/core_ext/string/inflections.rb4
2 files changed, 5 insertions, 9 deletions
diff --git a/activesupport/lib/core_ext/hash/indifferent_access.rb b/activesupport/lib/core_ext/hash/indifferent_access.rb
index 2353cfaf3b..3fe0999866 100644
--- a/activesupport/lib/core_ext/hash/indifferent_access.rb
+++ b/activesupport/lib/core_ext/hash/indifferent_access.rb
@@ -8,17 +8,17 @@ class HashWithIndifferentAccess < Hash
end
end
- alias_method :regular_reader, :[] unless method_defined?(:regular_reader)
+ alias_method :regular_read, :[]
def [](key)
case key
- when Symbol: regular_reader(key) || regular_reader(key.to_s)
- when String: regular_reader(key) || regular_reader(key.to_sym)
- else regular_reader(key)
+ when Symbol: regular_read(key) || regular_read(key.to_s)
+ when String: regular_read(key) || regular_read(key.to_sym)
+ else regular_read(key)
end
end
- alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
+ alias_method :regular_writer, :[]=
def []=(key, value)
regular_writer(key.is_a?(String) ? key.to_sym : key, value)
diff --git a/activesupport/lib/core_ext/string/inflections.rb b/activesupport/lib/core_ext/string/inflections.rb
index aa4ff3a74d..5d1070b00a 100644
--- a/activesupport/lib/core_ext/string/inflections.rb
+++ b/activesupport/lib/core_ext/string/inflections.rb
@@ -39,10 +39,6 @@ module ActiveSupport #:nodoc:
def foreign_key(separate_class_name_and_id_with_underscore = true)
Inflector.foreign_key(self, separate_class_name_and_id_with_underscore)
end
-
- def constantize
- Inflector.constantize(self)
- end
end
end
end