Changeset 8599
- Timestamp:
- 01/08/08 21:20:04 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2-0-stable/activesupport/lib/active_support/core_ext/string/inflections.rb
r5924 r8599 105 105 end 106 106 107 # Create a class name from a table name like Rails does for table names to models.107 # Create a class name from a plural table name like Rails does for table names to models. 108 108 # Note that this returns a string and not a Class. (To convert to an actual class 109 109 # follow classify with constantize.) … … 111 111 # Examples 112 112 # "egg_and_hams".classify #=> "EggAndHam" 113 # "post".classify #=> "Post" 113 # "posts".classify #=> "Post" 114 # 115 # Singular names are not handled correctly 116 # "business".classify #=> "Busines" 114 117 def classify 115 118 Inflector.classify(self) branches/2-0-stable/activesupport/lib/active_support/inflector.rb
r8585 r8599 219 219 end 220 220 221 # Create a class name from a table name like Rails does for table names to models.221 # Create a class name from a plural table name like Rails does for table names to models. 222 222 # Note that this returns a string and not a Class. (To convert to an actual class 223 223 # follow classify with constantize.) … … 225 225 # Examples 226 226 # "egg_and_hams".classify #=> "EggAndHam" 227 # "post".classify #=> "Post" 227 # "posts".classify #=> "Post" 228 # 229 # Singular names are not handled correctly 230 # "business".classify #=> "Busines" 228 231 def classify(table_name) 229 232 # strip out any leading schema name