diff options
author | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2014-08-17 23:01:13 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafael.franca@plataformatec.com.br> | 2014-08-17 23:01:13 -0300 |
commit | d2d809868c3eeb4d4a964382fc3df15cd5da70e4 (patch) | |
tree | 4f790872d6cb202b235ed21fc3c5ade6c4511399 /activerecord | |
parent | 76883f92374c6395f13c16628e1d87d40b6d2399 (diff) | |
parent | 6b0e834a194d112585f41deba0a40780d68e38c6 (diff) | |
download | rails-d2d809868c3eeb4d4a964382fc3df15cd5da70e4.tar.gz rails-d2d809868c3eeb4d4a964382fc3df15cd5da70e4.tar.bz2 rails-d2d809868c3eeb4d4a964382fc3df15cd5da70e4.zip |
Merge pull request #15889 from carnesmedia/model-name
Use #model_name on instances instead of classes
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/integration.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/integration.rb b/activerecord/lib/active_record/integration.rb index 31e2518540..15b2f65dcb 100644 --- a/activerecord/lib/active_record/integration.rb +++ b/activerecord/lib/active_record/integration.rb @@ -55,16 +55,16 @@ module ActiveRecord def cache_key(*timestamp_names) case when new_record? - "#{self.class.model_name.cache_key}/new" + "#{model_name.cache_key}/new" when timestamp_names.any? timestamp = max_updated_column_timestamp(timestamp_names) timestamp = timestamp.utc.to_s(cache_timestamp_format) - "#{self.class.model_name.cache_key}/#{id}-#{timestamp}" + "#{model_name.cache_key}/#{id}-#{timestamp}" when timestamp = max_updated_column_timestamp timestamp = timestamp.utc.to_s(cache_timestamp_format) - "#{self.class.model_name.cache_key}/#{id}-#{timestamp}" + "#{model_name.cache_key}/#{id}-#{timestamp}" else - "#{self.class.model_name.cache_key}/#{id}" + "#{model_name.cache_key}/#{id}" end end |