Skip to content

Commit

Permalink
Add active model serializers gem, configure for JSON, user serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
npauzenga committed Jan 2, 2016
1 parent 046b5ec commit fc14413
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gem "puma"
gem "interactor"
gem "figaro"
gem "knock"
gem "active_model_serializers"

group :developemnt, :test do
gem "pry-byebug"
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ GEM
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
active_model_serializers (0.10.0.rc3)
actionpack (>= 4.0)
activemodel (>= 4.0)
railties (>= 4.0)
activejob (4.2.4)
activesupport (= 4.2.4)
globalid (>= 0.3.0)
Expand Down Expand Up @@ -235,6 +239,7 @@ PLATFORMS
ruby

DEPENDENCIES
active_model_serializers
bcrypt (~> 3.1.7)
capybara
coveralls
Expand Down
3 changes: 3 additions & 0 deletions app/serializers/user_serializer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class UserSerializer < ActiveModel::Serializer
attributes :id, :first_name, :last_name, :email, :city, :state, :country
end
1 change: 1 addition & 0 deletions config/initializers/active_model_serializer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ActiveModel::Serializer.config.adapter = ActiveModel::Serializer::Adapter::JsonApi

0 comments on commit fc14413

Please sign in to comment.