aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/lib/controller/fake_models.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/lib/controller/fake_models.rb')
-rw-r--r--actionpack/test/lib/controller/fake_models.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/lib/controller/fake_models.rb b/actionpack/test/lib/controller/fake_models.rb
index b768553e7a..01c7ec26ae 100644
--- a/actionpack/test/lib/controller/fake_models.rb
+++ b/actionpack/test/lib/controller/fake_models.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "active_model"
Customer = Struct.new(:name, :id) do
@@ -26,6 +28,10 @@ Customer = Struct.new(:name, :id) do
def persisted?
id.present?
end
+
+ def cache_key
+ "#{name}/#{id}"
+ end
end
Post = Struct.new(:title, :author_name, :body, :secret, :persisted, :written_on, :cost) do