Skip to content

Commit 6331769

Browse files
beaubybf4
authored andcommitted
Correct minor typos
1 parent 80e7520 commit 6331769

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/active_model/serializer.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def self.attribute(attr, options = {})
116116

117117
# @api private
118118
# Used by FragmentCache on the CachedSerializer
119-
# to call attribute methods on the fragmented cached serializer
119+
# to call attribute methods on the fragmented cached serializer.
120120
def self.fragmented(serializer)
121121
self._fragmented = serializer
122122
end
@@ -174,7 +174,7 @@ def self.adapter
174174
end
175175

176176
# Used to cache serializer name => serializer class
177-
# when looked up by Serializer.get_serializer_for
177+
# when looked up by Serializer.get_serializer_for.
178178
def self.serializers_cache
179179
@serializers_cache ||= ThreadSafe::Cache.new
180180
end
@@ -215,8 +215,8 @@ def self.get_serializer_for(klass)
215215
attr_accessor :object, :root, :scope
216216

217217
# `scope_name` is set as :current_user by default in the controller.
218-
# If the instance does not have a method nameed `scope_name`, it
219-
# defines the method so that calls the +scope+.
218+
# If the instance does not have a method named `scope_name`, it
219+
# defines the method so that it calls the +scope+.
220220
def initialize(object, options = {})
221221
self.object = object
222222
self.instance_options = options
@@ -231,7 +231,7 @@ def initialize(object, options = {})
231231
end
232232
end
233233

234-
# Used by adapter as resource root
234+
# Used by adapter as resource root.
235235
def json_key
236236
root || object.class.model_name.to_s.underscore
237237
end

lib/active_model/serializer/adapter/fragment_cache.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def initialize(adapter, serializer, options)
1212

1313
# TODO: Use Serializable::Resource
1414
# TODO: call +constantize+ less
15-
# 1. Create a CachedSerializer and NonCachedSerializer from the serializer class.
16-
# 2. Serialize the above two with the given adapter.
17-
# 3. Pass their serializations to the adapter +::fragment_cache+.
15+
# 1. Create a CachedSerializer and NonCachedSerializer from the serializer class
16+
# 2. Serialize the above two with the given adapter
17+
# 3. Pass their serializations to the adapter +::fragment_cache+
1818
def fetch
1919
klass = serializer.class
20-
# It will split the serializer into two, one that will be cached and other wont
20+
# It will split the serializer into two, one that will be cached and one that will not
2121
serializers = fragment_serializer(serializer.object.class.name, klass)
2222

2323
# Instantiate both serializers
@@ -41,9 +41,9 @@ def fetch
4141

4242
private
4343

44-
# Given a serializer class and a hash of its cached and non0cached serializers
45-
# 1. Determine cached attributes from serializer class options.
46-
# 2. Add cached attributes to cached Serializer.
44+
# Given a serializer class and a hash of its cached and non-cached serializers
45+
# 1. Determine cached attributes from serializer class options
46+
# 2. Add cached attributes to cached Serializer
4747
# 3. Add non-cached attributes to non-cached Serializer
4848
def cached_attributes(klass, serializers)
4949
attributes = serializer.class._attributes
@@ -66,8 +66,8 @@ def cached_attributes(klass, serializers)
6666
end
6767

6868
# Given a resource name and its serializer's class
69-
# 1. Dyanmically creates a CachedSerializer and NonCachedSerializer
70-
# for a given class 'name'.
69+
# 1. Dyanmically creates a CachedSerializer and NonCachedSerializer
70+
# for a given class 'name'
7171
# 2. Call
7272
# CachedSerializer.cache(serializer._cache_options)
7373
# CachedSerializer.fragmented(serializer)

0 commit comments

Comments
 (0)