Skip to content

Commit

Permalink
Using the decorator pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
sliaquat committed Dec 7, 2014
1 parent c0fbde8 commit e2b997d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module Spree
module Api

class UsersController < Spree::Api::BaseController
UsersController.class_eval do

before_action :authenticate_user, :except => [:sign_up, :sign_in]

def sign_up
Expand Down
6 changes: 2 additions & 4 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Spree::Core::Engine.add_routes do
namespace :api, defaults: { format: 'json' } do

namespace :users do
namespace :api, defaults: {format: 'json'} do
resource :users do
post :sign_up
post :sign_in
end

end
end

0 comments on commit e2b997d

Please sign in to comment.