aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-24 22:07:09 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-06-24 22:07:09 -0700
commit071fe79279e89e650acce6613f13027527d01650 (patch)
tree6bac426d80d85c0cf8bb0c8e0b2b0fbe3cdffa54 /activesupport
parent6874caa4070f10cdbe104c9ac97dafd33dbdd282 (diff)
downloadrails-071fe79279e89e650acce6613f13027527d01650.tar.gz
rails-071fe79279e89e650acce6613f13027527d01650.tar.bz2
rails-071fe79279e89e650acce6613f13027527d01650.zip
Include cache key in ModelName
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/module/model_naming.rb5
1 files changed, 3 insertions, 2 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
index 26e76ab556..abb02f1f70 100644
--- a/activesupport/lib/active_support/core_ext/module/model_naming.rb
+++ b/activesupport/lib/active_support/core_ext/module/model_naming.rb
@@ -1,12 +1,13 @@
module ActiveSupport
class ModelName < String
- attr_reader :singular, :plural, :partial_path
+ attr_reader :singular, :plural, :cache_key, :partial_path
def initialize(name)
super
@singular = underscore.tr('/', '_').freeze
@plural = @singular.pluralize.freeze
- @partial_path = "#{tableize}/#{demodulize.underscore}".freeze
+ @cache_key = tableize
+ @partial_path = "#{@cache_key}/#{demodulize.underscore}".freeze
end
end