diff options
Diffstat (limited to 'activerecord/lib/active_record/aggregations.rb')
-rw-r--r-- | activerecord/lib/active_record/aggregations.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 314c40cfde..3f524f591c 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -128,7 +128,7 @@ module ActiveRecord options.assert_valid_keys(:class_name, :mapping) name = part_id.id2name - class_name = options[:class_name] || name_to_class_name(name) + class_name = options[:class_name] || name.camelize mapping = options[:mapping] || [ name, name ] reader_method(name, class_name, mapping) @@ -138,9 +138,6 @@ module ActiveRecord end private - def name_to_class_name(name) - name.capitalize.gsub(/_(.)/) { |s| $1.capitalize } - end def reader_method(name, class_name, mapping) module_eval <<-end_eval |