mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Style/StringLiterals single quote all the things
This commit is contained in:
@@ -15,7 +15,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def self.adapter_class(adapter)
|
||||
adapter_name = adapter.to_s.classify.sub("API", "Api")
|
||||
adapter_name = adapter.to_s.classify.sub('API', 'Api')
|
||||
"ActiveModel::Serializer::Adapter::#{adapter_name}".safe_constantize
|
||||
end
|
||||
|
||||
@@ -68,12 +68,12 @@ module ActiveModel
|
||||
parts = []
|
||||
parts << object_cache_key
|
||||
parts << @klass._cache_digest unless @klass._cache_options && @klass._cache_options[:skip_digest]
|
||||
parts.join("/")
|
||||
parts.join('/')
|
||||
end
|
||||
|
||||
def object_cache_key
|
||||
object_time_safe = @cached_serializer.object.updated_at
|
||||
object_time_safe = object_time_safe.strftime("%Y%m%d%H%M%S%9N") if object_time_safe.respond_to?(:strftime)
|
||||
object_time_safe = object_time_safe.strftime('%Y%m%d%H%M%S%9N') if object_time_safe.respond_to?(:strftime)
|
||||
(@klass._cache_key) ? "#{@klass._cache_key}/#{@cached_serializer.object.id}-#{object_time_safe}" : @cached_serializer.object.cache_key
|
||||
end
|
||||
|
||||
@@ -82,7 +82,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def meta_key
|
||||
serializer.meta_key || "meta"
|
||||
serializer.meta_key || 'meta'
|
||||
end
|
||||
|
||||
def root
|
||||
|
||||
@@ -23,7 +23,7 @@ module ActiveModel::Serializer::Lint
|
||||
# <tt>serializable_hash</tt> returns a hash representation of a object's attributes.
|
||||
# Typically, it is implemented by including ActiveModel::Serialization.
|
||||
def test_serializable_hash
|
||||
assert_respond_to resource, :serializable_hash, "The resource should respond to serializable_hash"
|
||||
assert_respond_to resource, :serializable_hash, 'The resource should respond to serializable_hash'
|
||||
resource.serializable_hash
|
||||
resource.serializable_hash(nil)
|
||||
end
|
||||
@@ -35,7 +35,7 @@ module ActiveModel::Serializer::Lint
|
||||
# <tt>read_attribute_for_serialization</tt> gets the attribute value for serialization
|
||||
# Typically, it is implemented by including ActiveModel::Serialization.
|
||||
def test_read_attribute_for_serialization
|
||||
assert_respond_to resource, :read_attribute_for_serialization, "The resource should respond to read_attribute_for_serialization"
|
||||
assert_respond_to resource, :read_attribute_for_serialization, 'The resource should respond to read_attribute_for_serialization'
|
||||
actual_arity = resource.method(:read_attribute_for_serialization).arity
|
||||
if defined?(::Rubinius)
|
||||
# 1 for def read_attribute_for_serialization(name); end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
VERSION = "0.10.0.rc2"
|
||||
VERSION = '0.10.0.rc2'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user