mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Cleaning up Caching Tests
This commit is contained in:
14
test/fixtures/poro.rb
vendored
14
test/fixtures/poro.rb
vendored
@@ -1,8 +1,6 @@
|
||||
verbose = $VERBOSE
|
||||
$VERBOSE = nil
|
||||
class Model < ActiveModelSerializers::Model
|
||||
FILE_DIGEST = Digest::MD5.hexdigest(File.open(__FILE__).read)
|
||||
|
||||
### Helper methods, not required to be serializable
|
||||
|
||||
# Convenience when not adding @attributes readers and writers
|
||||
@@ -21,10 +19,6 @@ class Model < ActiveModelSerializers::Model
|
||||
def respond_to_missing?(method_name, _include_private = false)
|
||||
attributes.key?(method_name.to_s.tr('=', '').to_sym) || super
|
||||
end
|
||||
|
||||
def cache_key_with_digest
|
||||
"#{cache_key}/#{FILE_DIGEST}"
|
||||
end
|
||||
end
|
||||
|
||||
# see
|
||||
@@ -58,7 +52,13 @@ Post = Class.new(Model)
|
||||
Like = Class.new(Model)
|
||||
Author = Class.new(Model)
|
||||
Bio = Class.new(Model)
|
||||
Blog = Class.new(Model)
|
||||
Blog = Class.new(Model) do
|
||||
FILE_DIGEST = Digest::MD5.hexdigest(File.open(__FILE__).read)
|
||||
|
||||
def cache_key_with_digest
|
||||
"#{cache_key}/#{FILE_DIGEST}"
|
||||
end
|
||||
end
|
||||
Role = Class.new(Model)
|
||||
User = Class.new(Model)
|
||||
Location = Class.new(Model)
|
||||
|
||||
Reference in New Issue
Block a user