aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/model_naming.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-06-19 16:10:24 +0200
committerJosé Valim <jose.valim@gmail.com>2009-06-19 16:10:24 +0200
commit8037fee9ff1dd13c421e6689229457c1ef084074 (patch)
treec60b2bf3e297be3e1bccb64ffd034acb137a7aa8 /activesupport/lib/active_support/core_ext/module/model_naming.rb
parent908b5305d4446433433313e315deb4083c58233e (diff)
parent9f7eaea201b2f408d9effbf82f2731957e284adf (diff)
downloadrails-8037fee9ff1dd13c421e6689229457c1ef084074.tar.gz
rails-8037fee9ff1dd13c421e6689229457c1ef084074.tar.bz2
rails-8037fee9ff1dd13c421e6689229457c1ef084074.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/model_naming.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/model_naming.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/model_naming.rb b/activesupport/lib/active_support/core_ext/module/model_naming.rb
deleted file mode 100644
index 13420bab07..0000000000
--- a/activesupport/lib/active_support/core_ext/module/model_naming.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'active_support/inflector'
-
-module ActiveSupport
- class ModelName < String
- attr_reader :singular, :plural, :element, :collection, :partial_path
- alias_method :cache_key, :collection
-
- def initialize(name)
- super
- @singular = ActiveSupport::Inflector.underscore(self).tr('/', '_').freeze
- @plural = ActiveSupport::Inflector.pluralize(@singular).freeze
- @element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(self)).freeze
- @collection = ActiveSupport::Inflector.tableize(self).freeze
- @partial_path = "#{@collection}/#{@element}".freeze
- end
- end
-end
-
-class Module
- # Returns an ActiveSupport::ModelName object for module. It can be
- # used to retrieve all kinds of naming-related information.
- def model_name
- @model_name ||= ActiveSupport::ModelName.new(name)
- end
-end