Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Strip out leading schema name in classify. References #5139. [schoenm…

…@earthlink.net]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4350 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 422cba934c218c7725c115615d942344aa067aba 1 parent 04fb7c3
Marcel Molina authored
View
3  activesupport/CHANGELOG
@@ -1,6 +1,9 @@
*SVN*
+* Strip out leading schema name in classify. References #5139. [schoenm@earthlink.net]
+
* Remove Enumerable#first_match since break(value) handles the use case well enough. [Nicholas Seckar]
+
Enumerable#first_match was like detect, but instead of returning the matching element, the yielded value returned. For example:
user_xml = adapters(:from => User, :to => Xml).first_match do |adapter|
View
3  activesupport/lib/active_support/inflector.rb
@@ -146,7 +146,8 @@ def tableize(class_name)
end
def classify(table_name)
- camelize(singularize(table_name))
+ # strip out any leading schema name
+ camelize(singularize(table_name.sub(/.*\./, '')))
end
def foreign_key(class_name, separate_class_name_and_id_with_underscore = true)
Please sign in to comment.
Something went wrong with that request. Please try again.