diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-24 22:07:09 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-24 22:07:09 -0700 |
commit | 071fe79279e89e650acce6613f13027527d01650 (patch) | |
tree | 6bac426d80d85c0cf8bb0c8e0b2b0fbe3cdffa54 /activesupport/lib/active_support | |
parent | 6874caa4070f10cdbe104c9ac97dafd33dbdd282 (diff) | |
download | rails-071fe79279e89e650acce6613f13027527d01650.tar.gz rails-071fe79279e89e650acce6613f13027527d01650.tar.bz2 rails-071fe79279e89e650acce6613f13027527d01650.zip |
Include cache key in ModelName
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/model_naming.rb | 5 |
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 |