From 29166b26b28643a613048bfc473c2b1c68dc2cce Mon Sep 17 00:00:00 2001 From: jeffrey008 Date: Wed, 12 Apr 2017 17:24:40 +0800 Subject: [PATCH 1/2] FIx the backticks The backticks are wrong, and making the remaining part of doc inside code block. Just a simple fix to the README. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c862a0b..da9cc705 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ end You can specify that serializers use the lower-camel key format at the config, class or instance level. -```ruby +````ruby ActiveModel::Serializer.setup do |config| config.key_format = :lower_camel @@ -245,13 +245,13 @@ class BlogLowerCamelSerializer < ActiveModel::Serializer end BlogSerializer.new(object, key_format: :lower_camel) -``` +```` ## Changing the default association key type You can specify that serializers use unsuffixed names as association keys by default. -`````ruby +````ruby ActiveModel::Serializer.setup do |config| config.default_key_type = :name end From 7d89e263047fb79c53f092d5bd26881c47d9917b Mon Sep 17 00:00:00 2001 From: jeffrey008 Date: Thu, 13 Apr 2017 09:41:51 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index da9cc705..5e1ea80b 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ end You can specify that serializers use the lower-camel key format at the config, class or instance level. -````ruby +```ruby ActiveModel::Serializer.setup do |config| config.key_format = :lower_camel @@ -245,17 +245,17 @@ class BlogLowerCamelSerializer < ActiveModel::Serializer end BlogSerializer.new(object, key_format: :lower_camel) -```` +``` ## Changing the default association key type You can specify that serializers use unsuffixed names as association keys by default. -````ruby +```ruby ActiveModel::Serializer.setup do |config| config.default_key_type = :name end -```` +``` This will build association keys like `comments` or `author` instead of `comment_ids` or `author_id`. @@ -932,7 +932,7 @@ now generates: class PostSerializer < ApplicationSerializer attributes :id end -```` +``` # Design and Implementation Guidelines