Skip to content
Browse files

undecorated_table_name was moved and refactored

  • Loading branch information...
1 parent 2573484 commit c91a7db4cfa0b3fe256e441432f051d7de0d1c0c @amatsuda amatsuda committed Jan 4, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 guides/source/active_support_core_extensions.md
View
5 guides/source/active_support_core_extensions.md
@@ -1431,11 +1431,10 @@ As the previous example shows, Active Support knows some irregular plurals and u
Active Record uses this method to compute the default table name that corresponds to a model:
```ruby
-# active_record/base.rb
+# active_record/model_schema.rb
def undecorated_table_name(class_name = base_class.name)
table_name = class_name.to_s.demodulize.underscore
- table_name = table_name.pluralize if pluralize_table_names
- table_name
+ pluralize_table_names ? table_name.pluralize : table_name
end
```

0 comments on commit c91a7db

Please sign in to comment.
Something went wrong with that request. Please try again.