We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5b5975 commit 90a9072Copy full SHA for 90a9072
lib/active_record/associated_object.rb
@@ -41,15 +41,13 @@ def cache_key_with_version
41
end
42
delegate :cache_version, to: :record
43
44
- def cache_key
45
- case
46
- when !record.cache_versioning?
47
- raise "ActiveRecord::AssociatedObject#cache_key only supports #{record.class}.cache_versioning = true"
48
- when new_record?
49
- "#{model_name.cache_key}/new"
50
- else
51
- "#{model_name.cache_key}/#{id}"
52
- end
+ def cache_key = case
+ when !record.cache_versioning?
+ raise "ActiveRecord::AssociatedObject#cache_key only supports #{record.class}.cache_versioning = true"
+ when new_record?
+ "#{model_name.cache_key}/new"
+ else
+ "#{model_name.cache_key}/#{id}"
53
54
55
include Caching
0 commit comments