Permalink
Browse files

Replace superfluous name_to_class_name variant with camelize. [Marcel…

… Molina Jr.]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
Marcel Molina
Marcel Molina committed Apr 29, 2006
1 parent 9f92dd3 commit aa72c465ec4aa641e9ea161110a43ad9c02d167b
Showing with 3 additions and 4 deletions.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −4 activerecord/lib/active_record/aggregations.rb
View
@@ -1,5 +1,7 @@
*SVN*
+* Replace superfluous name_to_class_name variant with camelize. [Marcel Molina Jr.]
+
* Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
@@ -128,7 +128,7 @@ def composed_of(part_id, options = {})
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 @@ def composed_of(part_id, options = {})
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

0 comments on commit aa72c46

Please sign in to comment.