-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Excluding attributes from serializers. Towards #26
- Loading branch information
Michael Parrish
committed
Jan 16, 2015
1 parent
372334b
commit 49cc356
Showing
6 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class BoardSerializer | ||
include TalkSerializer | ||
all_attributes | ||
all_attributes except: :permissions | ||
can_include :discussions | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class UserSerializer | ||
include TalkSerializer | ||
all_attributes | ||
all_attributes except: :email | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe BoardSerializer, type: :serializer do | ||
it_behaves_like 'a talk serializer', exposing: :all, including: [:discussions] | ||
it_behaves_like 'a talk serializer', exposing: :all, excluding: [:permissions], including: [:discussions] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe UserSerializer, type: :serializer do | ||
it_behaves_like 'a talk serializer', exposing: :all | ||
it_behaves_like 'a talk serializer', exposing: :all, excluding: [:email] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters