mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
re: RuboCop - get rid of redundant curly braces around a hash parameter
This commit is contained in:
@@ -7,10 +7,10 @@ module ActiveModel
|
||||
@author = Author.new(name: 'Steve K.')
|
||||
@author.bio = nil
|
||||
@author.roles = []
|
||||
@blog = Blog.new({ name: 'AMS Blog' })
|
||||
@post = Post.new({ title: 'New Post', body: 'Body' })
|
||||
@tag = Tag.new({ name: '#hashtagged' })
|
||||
@comment = Comment.new({ id: 1, body: 'ZOMG A COMMENT' })
|
||||
@blog = Blog.new(name: 'AMS Blog')
|
||||
@post = Post.new(title: 'New Post', body: 'Body')
|
||||
@tag = Tag.new(name: '#hashtagged')
|
||||
@comment = Comment.new(id: 1, body: 'ZOMG A COMMENT')
|
||||
@post.comments = [@comment]
|
||||
@post.tags = [@tag]
|
||||
@post.blog = @blog
|
||||
@@ -19,7 +19,7 @@ module ActiveModel
|
||||
@post.author = @author
|
||||
@author.posts = [@post]
|
||||
|
||||
@post_serializer = PostSerializer.new(@post, { custom_options: true })
|
||||
@post_serializer = PostSerializer.new(@post, custom_options: true)
|
||||
@author_serializer = AuthorSerializer.new(@author)
|
||||
@comment_serializer = CommentSerializer.new(@comment)
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ module ActiveModel
|
||||
class Serializer
|
||||
class AttributesTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
|
||||
@profile = Profile.new(name: 'Name 1', description: 'Description 1', comments: 'Comments 1')
|
||||
@profile_serializer = ProfileSerializer.new(@profile)
|
||||
@comment = Comment.new(id: 1, body: 'ZOMG!!', date: '2015')
|
||||
@serializer_klass = Class.new(CommentSerializer)
|
||||
|
||||
@@ -8,7 +8,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def test_overwrite_root
|
||||
serializer = VirtualValueSerializer.new(@virtual_value, { root: 'smth' })
|
||||
serializer = VirtualValueSerializer.new(@virtual_value, root: 'smth')
|
||||
assert_equal('smth', serializer.json_key)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user